[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Function id() does not work XSLT - XML - XML-Schema


Subject: [xsl] Function id() does not work XSLT - XML - XML-Schema
From: robhan@xxxxxx
Date: Fri, 20 Dec 2002 08:18:31 +0100 (MET)

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



Current Thread
Keywords