[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Different outputs when i change namespace in an xm
> But when i remove > xmlns="urn:schemas-microsoft-com:office:spreadsheet" > from the Workbook element in the input xml, i get a > completely other output. > Why is this? Because your elements are then in a completely different namespace so they will match completely different patterns and XPath expressions. Michael Kay Software AG home: Michael.H.Kay@xxxxxxxxxxxx work: Michael.Kay@xxxxxxxxxxxxxx > > Joeri > > input xml: > > <?xml version="1.0"?> > <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" > xmlns:o="urn:schemas-microsoft-com:office:office" > xmlns:x="urn:schemas-microsoft-com:office:excel" > xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" > xmlns:html="http://www.w3.org/TR/REC-html40"> > > <Worksheet ss:Name="Blad1"> > <Table ss:ExpandedColumnCount="6" ss:ExpandedRowCount="2" > x:FullColumns="1" x:FullRows="1"> > <Row> > <Cell ss:Index="6"> > <Data ss:Type="Number">100</Data> > <NamedCell ss:Name="OfferteNr"/> > </Cell> > </Row> > <Row> > <Cell ss:Index="6" ss:StyleID="s21"> > <Data ss:Type="String">test</Data> > </Cell> > </Row> > </Table> > </Worksheet> > </Workbook> > > test xsl: > > <?xml version="1.0" encoding="iso-8859-1"?> > <xsl:stylesheet > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> > > <xsl:output method="xml" > indent="yes"/> > > <xsl:template match="Workbook"> > <xsl:copy> > <xsl:apply-templates select="*"/> > </xsl:copy> > </xsl:template> > > <xsl:template match="*[ancestor::Workbook]"> > <xsl:copy> > <xsl:apply-templates select="*"/> > </xsl:copy> > </xsl:template> > > > </xsl:stylesheet> > > output WITH > xmlns="urn:schemas-microsoft-com:office:spreadsheet" in input > xml file > > <?xml version="1.0" encoding="utf-8"?> > > > > > > 100 > > > > > > test > > output WITHOUT > xmlns="urn:schemas-microsoft-com:office:spreadsheet" in input > xml file > > <?xml version="1.0" encoding="utf-8"?> > <Workbook xmlns:o="urn:schemas-microsoft-com:office:office" > xmlns:x="urn:schemas > -microsoft-com:office:excel" > xmlns:ss="urn:schemas-microsoft-com:office:spreadsh > eet" xmlns:html="http://www.w3.org/TR/REC-html40"> > <Worksheet> > <Table> > <Row> > <Cell> > <Data/> > <NamedCell/> > </Cell> > </Row> > <Row> > <Cell> > <Data/> > </Cell> > </Row> > </Table> > </Worksheet> > </Workbook> > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|