XSL query

M

Michael O'Shea

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 (e-mail address removed)
__/__/__/ 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
 
M

Martin Honnen

Michael said:
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>
 

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

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top