Subject: Re: XPATH question From: "Khalid Asad" <asad@xxxxxxxxxxxxx> Date: Thu, 30 Mar 2000 16:45:38 -0800 |
Looking at these examples more closely, it seems that example 4.4.3 is the closest to what I want, as long as I can use the output locations to refer to specific nodes in the source XML document. The location values generated all have position selectors, but only 'a' has more than one child node with the same name. Does this cause a problem, or must the output be 'a/b[1]/c' and 'a/b[2]/c' in order to select the appropriate source nodes? Example 4.4.2 and 4.5.1 don't appear to be as general as 4.4.3, and none of the three examples handle attributes. 4.4.2 does not handle multiple child elements with the same name. 4.5.1 does consider siblings for each node in the 'ancestor-or-self' axis, but it doesn't perform any sibling filtering. So if 'A' had a first child element named 'Y', then wouldn't the output be 'A:1.B:3.C:2', which would try to select the third 'B' child of 'A'? I think having an XPATH function in the XSL standard would be quite valuable. Granted, the equivalent can be implemented, but for arbitrary elements and attributes, implementing an XPATH function is not trivial. Furthermore, it appears to be costly in terms of performance, especially if I want to output the location for each element and attribute found in the source document. If an XPATH function were to become part of the standard, it's implementation would be reliable and parser developers would likely include code optimizations so that the XPATH function would be much more efficient than what appears to be achievable today. Khalid ----- Original Message ----- From: "Steve Tinney" <stinney@xxxxxxxxxxxxx> To: <xsl-list@xxxxxxxxxxxxxxxx> Sent: Monday, March 27, 2000 7:55 PM Subject: Re: XPATH question > > create in the output document the xpath location of the > > matched node. > > See the examples in the faq under 4.4.2, 4.4.3, 4.5.1. > > Steve > > > 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 -> |
---|---|---|
Re: XPATH question, Khalid Asad | Thread | xsl for formatting, violet wright |
RE: replacing character by another , Selva, Francis | Date | Flat file conversion to XML, joseph . j . fournes |
Month |