[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Function id() does not work XSLT - XML - XML-Schem

Subject: RE: Function id() does not work XSLT - XML - XML-Schema
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Fri, 20 Dec 2002 12:20:56 -0000
xslt id
XSLT 1.0 isn't defined to work with XML Schema. An implementation could
mark the ID attributes as such, but there is no particular reason why it
should.

If you can't define them as IDs in a DTD, the best thing is probably to
use xsl:key to find them.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> robhan@xxxxxx
> Sent: 20 December 2002 07:19
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Function id() does not work XSLT - XML - XML-Schema
> 
> 
> Hello,
>   
>  Question: Why does the Function id() not work??
>   
>  Explanation: Each Fact has references to Dimension. I'd like 
> to loop  through  all Fact and want to use refDim to get the 
> corresponding Dimension or  Dimension's. Attribute refDim is 
> of type "IDREFS". Attribute id of  Dimension  is of type "ID"
>   
>  For me it looks like, that the xsl transformation does not 
> know the  schema.  Correct? If yes, why?  I have 3 parts 
> which have to work together: XSD - XML - XSLT.  Is somewhere 
> a full example(not cutout's) for these 3 files which uses the 
>  id function?? 
>   
>  wkr
>  robert
>  ----- XSLT -----
>   
>  <?xml version="1.0" encoding="UTF-8"?>
>  <xsl:stylesheet version="1.0"  
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>         <xsl:template match="/">
>               ABC
>               <xsl:value-of select="id('ID000000')"/>
>               <xsl:for-each select="//Dimension">
>                      AAA            
>                      <xsl:value-of select="id('ID000000')"/>
>                      AAA
>                      <xsl:value-of select="."/>
>               </xsl:for-each>
>               DEF
>         </xsl:template>
>  </xsl:stylesheet>
>   
>   
>  ---- XML -----
>  <?xml version="1.0" encoding="UTF-8"?>
>  <?xml-stylesheet type="text/xsl" href="SpeedTest.xslt"?>  
> <SpeedTest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  xsi:noNamespaceSchemaLocation="file:///....../SpeedTest.xsd">
>         <Dimensions>
>               <Dimension id="ID000000">
>                      <DimensionValue>D0</DimensionValue>
>               </Dimension>
>         </Dimensions>
>         <Facts>
>               <Fact refDim="ID000000 ID000001">
>                      <Value>FactValue0</Value>
>               </Fact>
>         </Facts>
>  </SpeedTest>
>  ---- XSD ----
>  <?xml version="1.0" encoding="UTF-8"?>
>  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
>  elementFormDefault="qualified" attributeFormDefault="unqualified">
>         <xs:element name="SpeedTest">
>               <xs:complexType>
>                      <xs:sequence>
>                             <xs:element name="Dimensions">
>                                   <xs:complexType>
>                                          <xs:sequence>
>                                                 <xs:element  
> name="Dimension"  maxOccurs="unbounded">
>                                                       <xs:complexType>
>                                                              
> <xs:sequence>
>   
>  <xs:element name="DimensionValue">
>   
>  <xs:complexType>
>   
>  <xs:simpleContent>
>   
>  <xs:extension base="xs:string"/>
>   
>  </xs:simpleContent>
>   
>  </xs:complexType>
>   
>  </xs:element>
>                                                              
> </xs:sequence>
>                                                              
> <xs:attribute  name="id" type="xs:ID" use="required"/>
>                                                       
> </xs:complexType>
>                                                 </xs:element>
>                                          </xs:sequence>
>                                   </xs:complexType>
>                             </xs:element>
>                             <xs:element name="Facts">
>                                   <xs:complexType>
>                                          <xs:sequence>
>                                                 <xs:element 
> name="Fact"  maxOccurs="unbounded">
>                                                       <xs:complexType>
>                                                              
> <xs:sequence>
>   
>  <xs:element name="Value" type="xs:string"/>
>                                                              
> </xs:sequence>
>                                                              
> <xs:attribute  name="refDim" type="xs:IDREFS" use="required"/>
>                                                       
> </xs:complexType>
>                                                 </xs:element>
>                                          </xs:sequence>
>                                   </xs:complexType>
>                             </xs:element>
>                      </xs:sequence>
>               </xs:complexType>
>         </xs:element>
>  </xs:schema>
> 
> -- 
> +++ GMX - Mail, Messaging & more  http://www.gmx.net +++
> NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!
> 
> 
>  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.