[xsl] unique elements from different sourcefile

Subject: [xsl] unique elements from different sourcefile
From: Thomas Winkler <t.winkler@xxxxxxxxxxx>
Date: 03 Jan 2002 14:31:21 +0100
hi,
i'm really having a hard time figuring this little problem. because of
simplicity and performance i used the muench method for finding unique
elements and whatever else i needed. but this one just doesn't work for
me. maybe i'm just too desperate to solve it myself....

i have a xml represantation of a dtd, generated by norman walshs
dtdparse script in a separate xml file.

all i want is getting all possible children of a specific element. since
the content model of some elements can be very complicated (such as
"head"), most xpath axis don't work. 

i looked through the faq, but the methods with the following axis are
not working either. maybe someone could help me through this little one.

<dtd>
<element name="head" content-type="element">
<content-model-expanded>
  <sequence-group>
    <or-group occurrence="*">
      <element-name name="meta"/>
      <element-name name="link"/>
      <element-name name="object"/>
    </or-group>
    <or-group>
      <sequence-group>
        <element-name name="title"/>
        <or-group occurrence="*">
          <element-nam name="meta"/>
          <element-name name="link"/>
          <element-name name="object"/>
        </or-group>
        <sequence-group occurrence="?">
          <element-name name="base"/>
          <or-group occurrence="*">
            <element-name name="meta"/>
            <element-name name="link"/>
            <element-name name="object"/>
          </or-group>
        </sequence-group>
      </sequence-group>
      <sequence-group>
        <element-name name="base"/>
        <or-group occurrence="*">
          <element-name name="meta"/>
          <element-name name="link"/>
          <element-name name="object"/>
        </or-group>
        <sequence-group>
          <element-name name="title"/>
          <or-group occurrence="*">
            <element-name name="meta"/>
            <element-name name="link"/>
            <element-name name="object"/>
          </or-group>
        </sequence-group>
      </sequence-group>
    </or-group>
  </sequence-group>
</content-model-expanded>
</element>
</dtd>

i think i have to use at least two for loops, because if i generate the
ids in one for loop as usual (without document() function) the first
ones are not always identical and the xsl:for-each and xsl:key are not
at the same nodeset. do i first have to 

<xsl:for-each
select="document($xsldtdfile)/dtd/element[@name=current()]/content-model-expanded">

and then 

<xsl:for-each select=".//element-name">

with

<xsl:key name="uChilds" match=".//element-name" use="@name" />

????

what do my xsl:key and xsl:for-each(s) have to look like. i tried many
things, i just don't want to write here.

thank you for your help.

thomas winkler



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


Current Thread