PDA

View Full Version : problem with xml>xsl>xml transform


theone3
07-14-2006, 10:54 AM
I would like to be able to have a pre-defined xml tag (empty) that will be replaced with information from a transform, while keeping the structure of the document.

I.E. XML:
<sidebar>
<link name="Product Brochure" type="PDF" size="0.5MB">pb.pdf</brochure>
<series_brochure/>
</sidebar>

XSL:
<xsl:output method="xml" version="1.0" indent="yes"/>
<xsl:template match="//sidebar/series_brochure">
<link name="General Brochure" type="PDF" size="0.5MB">../sxb.pdf</link>
</xsl:template>

XML OUTPUT WANTED:
<sidebar>
<link name="Brochure" type="PDF" size="0.5MB">pb.pdf</brochure>
<link name="General Brochure" type="PDF" size="0.5MB">../sxb.pdf</link>
</sidebar> Problem is, when I try and implement it, IE & Firefox both spit it out as XHTML, the rest of the document becomes a long string of text. It would be great to centralise this sort of thing, because I'd like to be able to change the seriesx brochure (or whatever it is) centrally.


Anyone know what I'm doing wrong?