XSL query

Discussion in 'XML' started by Michael O'Shea, Mar 12, 2007.

  1. All, here are a few lines of contrived XSL to demonstrate my problem.


    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:test1="http://www.somewhere.com/test1"
    xmlns:test2="http://www.somewhere.com/test1"
    xmlns:mml="http://www.w3.org/1998/Math/MathML">
    <xsl:template match="/">
    <foo>
    <bar>bar1</bar>
    <bar>bar2</bar>
    </foo>
    </xsl:template>




    When I transform any bit of XML with this XSL, I get the following

    <?xml version="1.0"?>
    <foo xmlns:test1="http://www.somewhere.com/test1"
    xmlns:test2="http://www.somewhere.com/test1"
    xmlns:mml="http://www.w3.org/1998/Math/MathML">
    <bar>bar1</bar>
    <bar>bar2</bar>
    </foo>


    I want

    <?xml version="1.0"?>
    <foo><bar>bar1</bar><bar>bar2</bar></foo>


    Any suggestions to what I should be looking for in the docs would be
    most welcome. The XSL is contrived - production XSL requires the
    presence of the namespaces and the output produced is not static.

    Regards
    Mike


    TESSELLA
    __/__/__/ Tessella Support Services plc
    __/__/__/ 3 Vineyard Chambers, ABINGDON, OX14 3PX, England
    __/__/__/ Tel: (44)(0)1235-555511 Fax: (44)(0)1235-553301
    www.tessella.com Registered in England No. 1466429
    Michael O'Shea, Mar 12, 2007
    #1
    1. Advertising

  2. Michael O'Shea wrote:
    > All, here are a few lines of contrived XSL to demonstrate my problem.
    >
    >
    > <?xml version="1.0" encoding="ISO-8859-1"?>
    > <xsl:stylesheet version="1.0"
    > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    > xmlns:test1="http://www.somewhere.com/test1"
    > xmlns:test2="http://www.somewhere.com/test1"
    > xmlns:mml="http://www.w3.org/1998/Math/MathML">


    Add the attribute
    exlude-result-prefixes="test1 test2 mml"
    to the xsl:stylesheet element to avoid those namespace declarations in
    the result document
    <http://www.w3.org/TR/xslt#stylesheet-element>


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Mar 12, 2007
    #2
    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. Kevin Flood
    Replies:
    0
    Views:
    1,016
    Kevin Flood
    Sep 8, 2004
  2. Kevin Flood
    Replies:
    1
    Views:
    2,727
    Kevin Flood
    Sep 13, 2004
  3. Klaus Friese
    Replies:
    0
    Views:
    466
    Klaus Friese
    Nov 22, 2004
  4. Ray Tayek
    Replies:
    3
    Views:
    512
    Ray Tayek
    Nov 30, 2003
  5. Replies:
    1
    Views:
    3,595
    A. Bolmarcich
    May 27, 2005
Loading...

Share This Page