XPATH question
Oxygen general issues.
-
- Posts: 9436
- Joined: Fri Jul 09, 2004 5:18 pm
Re: XPATH question
Hi,
Something like this should work:
Regards,
Radu
Something like this should work:
Code: Select all
//*:properties[@name='propName']/@uiValue
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 2
- Joined: Thu Oct 26, 2017 10:42 pm
Re: XPATH question
You are right I was not clear in my description.
I would like to search for a certain value of a property name and extract the result of that uiValue only:
So, if:
<ns0:properties name="propName" uiValue="12">
Using something like the following I can't get to work? If I search with a 'propName' and then return 'uiValue' only as a result...
/*/*/*/properties[contains(@name,'propName')]/@uiValue
So the returning value would be 12...
Thank you...
I would like to search for a certain value of a property name and extract the result of that uiValue only:
So, if:
<ns0:properties name="propName" uiValue="12">
Using something like the following I can't get to work? If I search with a 'propName' and then return 'uiValue' only as a result...
/*/*/*/properties[contains(@name,'propName')]/@uiValue
So the returning value would be 12...
Thank you...
-
- Posts: 9436
- Joined: Fri Jul 09, 2004 5:18 pm
Re: XPATH question
Hi,
An XPath expression which starts with "/*/*/*" means that your "properties" element should be searched on the fourth level in the XML document. I consider that it is actually located there.
The problem is probably this part: properties[........... because in the original XML the "properties" element is bound to the prefix "ns0" which is mapped to a namespace, so you can either replace it with *:properties[.... meaning that you are searching for the "properties" element, no matter what namespace it is in, or you can be specific like this ns0:properties[.... as long as your XSLT maps the "ns0" prefix to that precise namespace in which the "properties" element is defined.
Regards,
Radu
An XPath expression which starts with "/*/*/*" means that your "properties" element should be searched on the fourth level in the XML document. I consider that it is actually located there.
The problem is probably this part: properties[........... because in the original XML the "properties" element is bound to the prefix "ns0" which is mapped to a namespace, so you can either replace it with *:properties[.... meaning that you are searching for the "properties" element, no matter what namespace it is in, or you can be specific like this ns0:properties[.... as long as your XSLT maps the "ns0" prefix to that precise namespace in which the "properties" element is defined.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service