|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
templates and iterating attributes from xpath expressionI doubt it can be done but .......... I ve been trying to see if ASSIGN might return a list of current attributes (or ideally a specific ndexed attribute) Having hunted around I came across http://www.velocityreviews.com/forums/t167301-seek-xpath-expression-where-an-attribute-name-is-a-regular-expression.html which seems to suggest that <assign var="?findattributenames" expr="contains(local-name(@*),'gender')"/> should select the attribute 'gender' (using people.xml). this returns false. Is this correct? _______________________________________________ dev-tech-xml mailing list dev-tech-xml@... https://lists.mozilla.org/listinfo/dev-tech-xml |
|
|
Re: templates and iterating attributes from xpath expressionOK seems Ive found a working solution since @* defaults to the first
attribute which is good enough for my needs - if this is a bug PLEASE DONT FIX IT!! "rvj" <rvj@...> wrote in message news:bY6dnRW2zMqWsbjUnZ2dnUVZ_t7inZ2d@...... > > I doubt it can be done but .......... > > I ve been trying to see if ASSIGN might return a list of current > attributes (or ideally a specific ndexed attribute) > > Having hunted around I came across > > http://www.velocityreviews.com/forums/t167301-seek-xpath-expression-where-an-attribute-name-is-a-regular-expression.html > > which seems to suggest that > > <assign var="?findattributenames" > expr="contains(local-name(@*),'gender')"/> > > should select the attribute 'gender' (using people.xml). this returns > false. > > Is this correct? > > > > > > > > > > _______________________________________________ dev-tech-xml mailing list dev-tech-xml@... https://lists.mozilla.org/listinfo/dev-tech-xml |
|
|
Re: templates and iterating attributes from xpath expressionseems not - seems @*[index number] is the syntax I was looking for ! "rvj" <rvj@...> wrote in message news:_dadnexv1J9D9bjUnZ2dnUVZ_sTinZ2d@...... > OK seems Ive found a working solution since @* defaults to the first > attribute which is good enough for my needs > > - if this is a bug PLEASE DONT FIX IT!! > > > > "rvj" <rvj@...> wrote in message > news:bY6dnRW2zMqWsbjUnZ2dnUVZ_t7inZ2d@...... >> >> I doubt it can be done but .......... >> >> I ve been trying to see if ASSIGN might return a list of current >> attributes (or ideally a specific ndexed attribute) >> >> Having hunted around I came across >> >> http://www.velocityreviews.com/forums/t167301-seek-xpath-expression-where-an-attribute-name-is-a-regular-expression.html >> >> which seems to suggest that >> >> <assign var="?findattributenames" >> expr="contains(local-name(@*),'gender')"/> >> >> should select the attribute 'gender' (using people.xml). this returns >> false. >> >> Is this correct? >> >> >> >> >> >> >> >> >> >> > > _______________________________________________ dev-tech-xml mailing list dev-tech-xml@... https://lists.mozilla.org/listinfo/dev-tech-xml |
|
|
Re: templates and iterating attributes from xpath expressionrvj wrote:
> OK seems Ive found a working solution since @* defaults to the first > attribute which is good enough for my needs >> expr="contains(local-name(@*),'gender')"/> @* selects a node-set of all attribute but local-name(@*) returns the name of the first node in that node-set. -- Martin Honnen http://JavaScript.FAQTs.com/ _______________________________________________ dev-tech-xml mailing list dev-tech-xml@... https://lists.mozilla.org/listinfo/dev-tech-xml |
|
|
Re: templates and iterating attributes from xpath expressionthanks - just about getting there
ps had any problem with parent syntax ? ../@*[1] seems ok but problems with a) ../name() b) ../name(@*[1]) "Martin Honnen" <mahotrash@...> wrote in message news:bYydnUzyeb5TDrjUnZ2dnUVZ_gydnZ2d@...... > rvj wrote: >> OK seems Ive found a working solution since @* defaults to the first >> attribute which is good enough for my needs > > >>> expr="contains(local-name(@*),'gender')"/> > > @* selects a node-set of all attribute but local-name(@*) returns the name > of the first node in that node-set. > > > -- > > Martin Honnen > http://JavaScript.FAQTs.com/ _______________________________________________ dev-tech-xml mailing list dev-tech-xml@... https://lists.mozilla.org/listinfo/dev-tech-xml |
|
|
Re: templates and iterating attributes from xpath expressionrvj wrote:
> thanks - just about getting there > > ps had any problem with parent syntax ? ../@*[1] seems ok but problems > with > > a) ../name() name(..) gives you the name of the parent in XPath 1.0. > b) ../name(@*[1]) name(../@*[1]) gives you the name of the first attribute of the parent in XPath 1.0. The syntax you have choosen is allowed in XPath 2.0 and XQuery 1.0 but not in XPath 1.0. -- Martin Honnen http://JavaScript.FAQTs.com/ _______________________________________________ dev-tech-xml mailing list dev-tech-xml@... https://lists.mozilla.org/listinfo/dev-tech-xml |
|
|
Re: templates and iterating attributes from xpath expressionGreat !
"Martin Honnen" <mahotrash@...> wrote in message news:4-2dnaOspIMVArfUnZ2dnUVZ_uGdnZ2d@...... > rvj wrote: >> thanks - just about getting there >> >> ps had any problem with parent syntax ? ../@*[1] seems ok but problems >> with >> >> a) ../name() > name(..) > gives you the name of the parent in XPath 1.0. > >> b) ../name(@*[1]) > > name(../@*[1]) > gives you the name of the first attribute of the parent in XPath 1.0. > > The syntax you have choosen is allowed in XPath 2.0 and XQuery 1.0 but not > in XPath 1.0. > > > -- > > Martin Honnen > http://JavaScript.FAQTs.com/ _______________________________________________ dev-tech-xml mailing list dev-tech-xml@... https://lists.mozilla.org/listinfo/dev-tech-xml |
| Free embeddable forum powered by Nabble | Forum Help |