[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

Subject: RE: Different outputs when i change namespace in an xml
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Tue, 19 Mar 2002 14:40:57 -0000
xsl change namespace
> 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.