XML formatting in Mozilla Firefox

Discussion in 'XML' started by mic123@gmail.com, Jun 14, 2006.

  1. Guest

    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
    , Jun 14, 2006
    #1
    1. Advertising

  2. wrote:
    > 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.


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Jun 14, 2006
    #2
    1. Advertising

  3. Guest

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

    Martin Honnen wrote:
    > wrote:
    > > 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.
    >
    >
    > --
    >
    > Martin Honnen
    > http://JavaScript.FAQTs.com/
    , Jun 14, 2006
    #3
  4. wrote:
    > 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.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Jun 14, 2006
    #4
  5. wrote:
    > 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.

    >>> My problem is that I want to simply display the XML as idented text,
    >>> but the browser adds "-" signs to the text.


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

    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
    Joe Kesselman, Jun 14, 2006
    #5
  6. Guest

    Joe Kesselman wrote:
    > wrote:
    > > 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.
    >
    > >>> My problem is that I want to simply display the XML as idented text,
    > >>> but the browser adds "-" signs to the text.

    >
    > Note that the -'s are actually a browser feature -- they're active
    > controls that can be used to minimize/maximize subtrees of the document.
    >
    > --
    > () ASCII Ribbon Campaign | Joe Kesselman
    > /\ Stamp out HTML e-mail! | System architexture and kinetic poetry


    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
    , Jun 14, 2006
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ed
    Replies:
    8
    Views:
    6,033
    Ken Cox [Microsoft MVP]
    Nov 23, 2004
  2. Alex D.
    Replies:
    9
    Views:
    10,521
    Alex D.
    Feb 9, 2006
  3. Alex D.

    treeview and firefox-mozilla

    Alex D., Feb 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    2,476
    Alex D.
    Feb 9, 2006
  4. Paul Furman

    <ul> formatting problem Mozilla

    Paul Furman, Feb 25, 2004, in forum: HTML
    Replies:
    13
    Views:
    894
    Eric Bohlman
    Mar 1, 2004
  5. Henri
    Replies:
    9
    Views:
    1,832
    Toby Inkster
    Feb 22, 2005
Loading...

Share This Page