Subject: RE: [xsl] Question on parsing an encapsulated message From: "Robert Koberg" <rob@xxxxxxxxxx> Date: Fri, 13 Dec 2002 13:29:45 -0800 |
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: [xsl] 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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Question on parsing an encaps, Paul | Thread | [xsl] excluding xml fragments by at, Carl Yu |
Re: [xsl] excluding xml fragments b, Mike Brown | Date | Re: [xsl] skipping table-header of , W. Eliot Kimber |
Month |