RE: [xsl] Building XML from XPATHS in XSLT 2.0

Subject: RE: [xsl] Building XML from XPATHS in XSLT 2.0
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Mon, 26 Apr 2004 22:36:03 +0100
Some thoughts to help you specify the problem more precisely:

You presumably mean "build an XML document for which none of these XPath
expressions returns an empty sequence."

You say "any valid XPath". Are you restricting this to path expressions?
Absolute path expressions? Are they always evaluated with the root as the
context node?

In general of course there may be no solution. For example if you have two
paths /a and /b there is no document that gives a non-empty answer for both.

Michael Kay 

> -----Original Message-----
> From: gary@xxxxxxxxxxx [mailto:gary@xxxxxxxxxxx] 
> Sent: 26 April 2004 20:51
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Building XML from XPATHS in XSLT 2.0
> 
> Hi Guys,
> 
> I have just started working on a problem which is quite 
> interesting. I have
> some xml that can contain any valid XPATH as an attribute 
> string and I would
> like to go through all the XPATHS listed and build some XML 
> based on them.
> i.e.
> 
> <frame>
>  <block
> XPATH="/ClinicalDocument/recordTarget/patientRole/patientPatie
> nt/name/family
> "/>
>  <block
> XPATH="/ClinicalDocument/recordTarget/patientRole/patientPatie
> nt/name/given"
> />
>  <block
> XPATH="/ClinicalDocument/component/bodyChoice/StructuredBody/c
> omponent/bodyC
> hoice/StructuredBody/component/section/component/section/entry
> /entryChoice/O
> bservation/value"/>
>  <block
> XPATH="/ClinicalDocument/component/bodyChoice/StructuredBody/c
> omponent/bodyC
> hoice/StructuredBody/component/section[@title=$section-name]/c
> omponent/secti
> on[@title=$subsection-name]/entry/entryChoice/Observation/part
> icipant/partic
> ipatingEntity/associatedPerson/name"/>
>  <block
> XPATH="/ClinicalDocument/component/bodyChoice/StructuredBody/c
> omponent/bodyC
> hoice/StructuredBody/component/section/component/section/entry
> /entryChoice/O
> bservation/value"/>
> </frame>
> 
> If anyone has already done something similar to this and 
> wants to share some
> code it would be appreciated or if anyone is interstested in 
> the solution
> let me know and I will post the group back when I have found 
> a solution to
> the problem!
> 
> Many Thanks
> 
> Gary Cornelius

Current Thread