[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Question on parsing an encapsulated message
Hi, You will need to get the referenced schema. You can do something like: <xsl:template match="xs:include"> <xsl:apply-templates select="document(@schemaLocation)/xs:schema/xs:element"/> ... then it can use the same templates that match elements in your primary schema. best, -Rob > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Paul > Sent: Friday, December 13, 2002 12:21 PM > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: Question on parsing an encapsulated message > > > Hi > > Say my style sheet is for a schema(schema-1), but > schema-1 contains a xs:include, refering to other > schema's contents, will the style sheet deal with them > directly ? How can I reach those contents ? > Thanks for yr help > > Paul. > > ==== schema-1 ==== > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > elementFormDefault="qualified" > attributeFormDefault="unqualified"> > > <xs:include schemaLocation = "clientGroup.xsd" /> > <xs:element name="cust-ALIAS"/> > </xs:schema> > > > ===== clientGroup.xsd(refer by above schema) ====== > <xs:schema> > <xs:element name="cust-info"> > <xs:complexType> > <xs:sequence> > <xs:element ref="name" minOccurs="0"/> > <xs:element ref="email" minOccurs="0"/> > <xs:element ref="account" minOccurs="0"/> > </xs:sequence> > </xs:complexType> > </xs:element> > </xs:schema> > > > ==== xsl(this is just testing how to reach > clientGroup.xsd information)==== > <xsl:template match="xs:schema"> > <xsl:value-of select="*/@name"/> > <xsl:for-each select="xs:element"> > name<xsl:value-of > select="descendant-or-self::xs:element/@name"/> > recognized.ref<xsl:value-of > select="descendant-or-self::xs:element/@ref"/> > </xsl:for-each> > </xsl:template> > > > __________________________________________________ > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up now. > http://mailplus.yahoo.com > > 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
|