XML formatting in Mozilla Firefox

M

mic123

I am creating an xml document using XMLOutputter in JAVA, then
displaying the xml file in Firefox browser.

My problem is that I want to simply display the XML as idented text,
but the browser adds "-" signs to the text.
So when I try to copy+paste the text I also get the "-" signs with it.

Can I cause the browser to display an idented XML text without the "-"
signs??

An example of copy paste:
*******************************

-
<XML>
-
<defaultConfig>
-
<Server checkInterval="300"/>
</Server>
</defaultConfig>
</XML>

Thanks in advance
 
M

Martin Honnen

I am creating an xml document using XMLOutputter in JAVA, then
displaying the xml file in Firefox browser.

My problem is that I want to simply display the XML as idented text,
but the browser adds "-" signs to the text.
So when I try to copy+paste the text I also get the "-" signs with it.

Can I cause the browser to display an idented XML text without the "-"
signs??

If the XML is not associated with a stylesheet (e.g. CSS stylesheet or
XSLT stylesheet) and if there are no elements in namespaces Mozilla
supports (e.g. XHTML namespace, MathML namespace, SVG namespace) then
Mozilla applies a default XSLT stylesheet to render the tree of the
document in a pretty printed form.
If you don't want that then define your own stylesheet and associate it
with e.g.
<?xml-stylesheet type="text/css" href="file.css"?>
with the XML document.
 
M

michal2

Do you happen to have such stylesheet that will display the XML tree
without the "-" signs? (or know where I can get one...)
 
M

Martin Honnen

Do you happen to have such stylesheet that will display the XML tree
without the "-" signs? (or know where I can get one...)

Those signs are there as script allows to collapse and extend subtrees
dynamically. If you want to see the XML source then use view source.
As for a stylesheet, I can't point you to one.
 
J

Joe Kesselman

Do you happen to have such stylesheet that will display the XML tree
without the "-" signs? (or know where I can get one...)

The standard identity stylesheet, with xsl:eek:utput set to do indenting,
ought to do the job.

Note that the -'s are actually a browser feature -- they're active
controls that can be used to minimize/maximize subtrees of the document.
 
M

michal2

Joe said:
The standard identity stylesheet, with xsl:eek:utput set to do indenting,
ought to do the job.


Note that the -'s are actually a browser feature -- they're active
controls that can be used to minimize/maximize subtrees of the document.

I know these "-" signs are for collapsing, but I wish to display the
XML as idented text, without those signs.
I can't use view-source and then copy-paste since the identation is
ruined
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,002
Messages
2,570,260
Members
46,858
Latest member
FlorrieTuf

Latest Threads

Top