C
cgaden
Hi everyone,
I have a problem that I've been trying to figure out for a while but I
just can't seem to get it right. I have the following XML fragment:
<Page ID="x1" Schema="Folder">
-<Page ID="x10" Schema="Common">
--<Page ID="x100" Schema="Common" />
--<Page ID="x200" Schema="Common" />
--<Page ID="x300" Schema="Common" />
---<Page ID="x301" Schema="Folder">
----<Page ID="x3010" Schema="Link" />
----<Page ID="x3011" Schema="Link" />
----<Page ID="x3012" Schema="Link" />
----<Page ID="x3013" Schema="Link" />
----<Page ID="x3014" Schema="Link" />
----<Page ID="x3015" Schema="Link" />
----<Page ID="x3016" Schema="Link" />
---</Page>
---<Page ID="x302" Schema="Common">
----<Page ID="x3020" Schema="Common"/>
---</Page>
---<Page ID="x303" Schema="Common">
----<Page ID="x3030" Schema="Link" />
----<Page ID="x3031" Schema="Link" />
---</Page>
---<Page ID="x304" Schema="List">
----<Page ID="x3040" Schema="Folder" />
---</Page>
---<Page ID="x305" Schema="Common" />
--<Page ID="x400" Schema="Common" />
--<Page ID="x500" Schema="Common" />
--<Page ID="x600" Schema="Common" />
-</Page>
</Page>
I'm trying to retrieve all of the Pages below x300 (not including x300)
except those where the Schema value is 'Folder' or the parent page's
Schema value is 'Folder' (specifically these pages should be excluded:
ID = x301 [and children x3010 - x3016] and x3040). I've been able to
successfully remove x301 and children using this xPath query:
//*[@ID='x300']/Page[@Schema != 'Folder']
However, when I modify the query to:
//*[@ID='x300']/descendant-or-self:age[@Schema != 'Folder']
The resultset breaks completely with all of the 3 nodes getting
promoted to level 2.
I've also tried to use the ancestor-or-self method but this also does
not return the results I'm attempting to retrieve - I actually get no
results. I believe that this occurs because there is a Page with a
Schema value of 'Folder' below my initial criteria and that the
sub-selection occurs after the attribute restriction is applied.
I appreciate any help. Thank you.
-Christian
I have a problem that I've been trying to figure out for a while but I
just can't seem to get it right. I have the following XML fragment:
<Page ID="x1" Schema="Folder">
-<Page ID="x10" Schema="Common">
--<Page ID="x100" Schema="Common" />
--<Page ID="x200" Schema="Common" />
--<Page ID="x300" Schema="Common" />
---<Page ID="x301" Schema="Folder">
----<Page ID="x3010" Schema="Link" />
----<Page ID="x3011" Schema="Link" />
----<Page ID="x3012" Schema="Link" />
----<Page ID="x3013" Schema="Link" />
----<Page ID="x3014" Schema="Link" />
----<Page ID="x3015" Schema="Link" />
----<Page ID="x3016" Schema="Link" />
---</Page>
---<Page ID="x302" Schema="Common">
----<Page ID="x3020" Schema="Common"/>
---</Page>
---<Page ID="x303" Schema="Common">
----<Page ID="x3030" Schema="Link" />
----<Page ID="x3031" Schema="Link" />
---</Page>
---<Page ID="x304" Schema="List">
----<Page ID="x3040" Schema="Folder" />
---</Page>
---<Page ID="x305" Schema="Common" />
--<Page ID="x400" Schema="Common" />
--<Page ID="x500" Schema="Common" />
--<Page ID="x600" Schema="Common" />
-</Page>
</Page>
I'm trying to retrieve all of the Pages below x300 (not including x300)
except those where the Schema value is 'Folder' or the parent page's
Schema value is 'Folder' (specifically these pages should be excluded:
ID = x301 [and children x3010 - x3016] and x3040). I've been able to
successfully remove x301 and children using this xPath query:
//*[@ID='x300']/Page[@Schema != 'Folder']
However, when I modify the query to:
//*[@ID='x300']/descendant-or-self:age[@Schema != 'Folder']
The resultset breaks completely with all of the 3 nodes getting
promoted to level 2.
I've also tried to use the ancestor-or-self method but this also does
not return the results I'm attempting to retrieve - I actually get no
results. I believe that this occurs because there is a Page with a
Schema value of 'Folder' below my initial criteria and that the
sub-selection occurs after the attribute restriction is applied.
I appreciate any help. Thank you.
-Christian