[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] How to insert a snippet of XSD into HTML using serial
Hi Folks, I have this XML Schema: ----------------------------------------------------------------------------- <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:foo="http://www.foo.org" xmlns:bar="http://www.bar.org" xmlns:blah="http://www.blah.org"> <xs:element name="Document"> <xs:complexType> <xs:sequence> <xs:element name="Title" type="xs:string" minOccurs="0" /> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> ----------------------------------------------------------------------------- I want to embed the Title element declaration into an HTML document. That is, when I view the HTML document in a browser I want this to display: <xs:element name="Title" type="xs:string" minOccurs="0" /> In my XSLT, I am using the new serialize function to output the Title element: <xsl:value-of select="serialize(//xs:element[@name eq 'Title'])" /> However, when I view the HTML document in a browser, I see a bunch of namespace declarations bundled with the Title element: <xs:element xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:foo="http://www.foo.org" xmlns:bar="http://www.bar.org" xmlns:blah="http://www.blah.org" name="Title" type="xs:string" minOccurs="0"/> I don't want all those namespace declarations. How do I omit them? I tried adding a serialization parameter to the serialize function: <xsl:variable name="output-serialization-parameters" as="element()"> <output:serialization-parameters xmlns:output="http://www.w3.org/2010/xslt-xquery-serialization"> <output:omit-xml-declaration value="yes"/> <output:indent value="yes"/> </output:serialization-parameters> </xsl:variable> <xsl:value-of select="serialize((//xs:element[@name eq 'Title'], $output-serialization-parameters)" /> That had no effect. Is there a serialization parameter to suppress the output of namespace declarations? What is the solution to this problem? /Roger
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|