Re: [xsl] display parts of XML tree with xsl:copy ?

Subject: Re: [xsl] display parts of XML tree with xsl:copy ?
From: Robert Sösemann <robert.soesemann@xxxxxx>
Date: Fri, 1 Mar 2002 12:34:47 +0100
> You must have some way of indicating the nodes that you want to pull
> out from the source document - how do you intend, or want, to do that?
> Do you want a general stylesheet that you import into a more specific
> stylesheet that selects the nodes you want to retain? How does the
> stylesheet that you want help with fit into the bigger picture of what
> you're doing?

This will be done by an XML-formated query in the form of:

<query>
  <boolean op="and">
    <boolean op="or">
      <term value="Donald Knuth"
            field="dc:creator"
            relation="eq"/>
      <term value="Algorithms"
            field="dc:title"
            relation="eq"
            truncation="both"/>
    </boolean>
    <term value="2000-02-01"
          field="dc:date"
          relation="geq"
          refinement="dc:available"
          encoding="dc:W3CDTF"/>
  </boolean>
</query>

>
> Finally, there's the question of what you want from the result. You
> want the selected nodes, obviously; I think that you want their
> ancestors as well; and it seems like you want certain other nodes in
> addition. How can you tell which nodes you want and which you don't?
> In the example you gave, what's special about the volume and number
> elements? Is it that they're children of an ancestor *and* don't have
> child elements themselves? In the general case, what are the
> characteristics of the nodes that you want to copy as opposed to those
> that you want to ignore?


As I use standard namespace domains like Dublin Core an the Source doc might
not have element/attribs of that ns, I also provide an
XML-formated source description which
a: maps those standardized dc: stuff into the doc's own names. This
descriptor doc will also hold information on the supertree that
should be inserted to the query result when a certain element is part of  a
condition.

In the <SigmodRecord> example this would be something like that:

article <-- title
article <-- authors/author
issue <-- volume
...
This means if ask for a title an author I want the output still be part of
the inputs dtd (root still SigmoRecord) but I only want to see
the branch that lead to the article thats fullfils the query.

As I can never be sure that there is not valuable info in the supertree the
only thing I sure want to get rid is other brother <article>'s, that don't
fullfil the query.

I think this should work in general. What do you think.





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


Current Thread