This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Schema Exploration...


I'm trying to select a schema element node relative to the current 
xs:element node I've referenced in a parameter ($schema_node). The 
problem is that there are several cases that need to be checked for:

xs:element/*[@name='test1a' or @ref='test1b']
xs:element/xs:complexType/xs:choice/*[@name='test2a' or @ref='test2b']
xs:element/xs:complexType/xs:sequence/*[@name='test3a' or @ref='test3b']

...
   <xs:element name="test1">
      <xs:element name="test1a"/>
      <xs:element ref="test1b"/>
   </xs:element>

   <xs:element name="test2">
      <xs:complexType>
          <xs:choice>
             <xs:element name="test2a"/>
             <xs:element ref="test2b"/>
             ...
          </xs:choice>
       </xs:complexType>
   </xs:element>

   <xs:element name="test3">
      <xs:complexType>
	<xs:sequence>
             <xs:element name="test3a"/>
             <xs:element ref="test3b"/>
              ...
          </xs:sequence>
       </xs:complexType>
   </xs:element>
...

I'm struggling to get an pattern that will match all these cases, 
currently I have one case matched and working:

<xsl:param name="node_name" select="name()"/>

<xsl:apply-templates select="
$schema_node/xs:element[@name=$node_name or @ref=$node_name]
"/>

I'm not sure how I would expand this case to include the other ones.

-Mark



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]