XSL query

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael O'Shea

    #1

    XSL query


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


    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:styleshe et version="1.0"
    xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
    xmlns:test1="ht tp://www.somewhere.c om/test1"
    xmlns:test2="ht tp://www.somewhere.c om/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="ht tp://www.somewhere.c om/test1"
    xmlns:test2="ht tp://www.somewhere.c om/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>bar 1</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 Michael.OShea@t essella.com
    __/__/__/ 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

  • Martin Honnen

    #2
    Re: XSL query

    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:styleshe et version="1.0"
    xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
    xmlns:test1="ht tp://www.somewhere.c om/test1"
    xmlns:test2="ht tp://www.somewhere.c om/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/

    Comment

    Working...