I read that XBRL has XPointer functionalty.
Can I use this independently: Can I use a xml text file as input to the parser, supply an xpointer expression and get the offset in the xml of the result nodeset. If this is possible can you please supply a hint to get me started?
Thanks,
DD
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
XBRLAPI does have a separate stand-alone module for XPointer handling.
It is packaged as the xbrlapi-xpointer jar and that should be all you require aside from the xbrlapi-utilities jar file that defines various constants etc.
To see how to use the xpointer module, take a look at the main {} routine in the org.xbrlapi.xpointer.PointerGrammar class.
Note, however, that this module is all about understanding an XPointer expression, not applying that understanding to an XML document. Thus, it will get you an ID for an ID based XPointer expression but it is up to you how to find and return the right nodes from the XML resource. Likewise, it will give you back and element scheme XPointer structure that you can apply to walk through the nodes of an XML document but it will not do the walking for you. This is because XPointer is extensible and there are a lot of schemes out there that you could use this processor with. The processor will find parts of the XPointer expression, determine what scheme they are in and give you back the information content of that part of the XPointer expression so that you can use it as you wish.
If you do put together examples based on ID or element scheme XPointer expressions that do return a node in an XML DOM structure, then I would be happy to include them in the set of examples that comes with the XBRLAPI but that work is not a priority for me right now.
I hope that helps some,
Regards
Geoff Shuetrim
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You would need to extend the XPointer processor to work with that scheme.
Take a look at org.xbrlapi.xpointer.tests.PointerGrammarTestCase#testElementPointer()
to see how to get access to the parsed parts of the XPointer. What you do with them thereafter is up to you though.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I read that XBRL has XPointer functionalty.
Can I use this independently: Can I use a xml text file as input to the parser, supply an xpointer expression and get the offset in the xml of the result nodeset. If this is possible can you please supply a hint to get me started?
Thanks,
DD
XBRLAPI does have a separate stand-alone module for XPointer handling.
It is packaged as the xbrlapi-xpointer jar and that should be all you require aside from the xbrlapi-utilities jar file that defines various constants etc.
See: http://www.xbrlapi.org/xpointer/
and have a look at:
The relevant javadoc documentation.
To see how to use the xpointer module, take a look at the main {} routine in the org.xbrlapi.xpointer.PointerGrammar class.
Note, however, that this module is all about understanding an XPointer expression, not applying that understanding to an XML document. Thus, it will get you an ID for an ID based XPointer expression but it is up to you how to find and return the right nodes from the XML resource. Likewise, it will give you back and element scheme XPointer structure that you can apply to walk through the nodes of an XML document but it will not do the walking for you. This is because XPointer is extensible and there are a lot of schemes out there that you could use this processor with. The processor will find parts of the XPointer expression, determine what scheme they are in and give you back the information content of that part of the XPointer expression so that you can use it as you wish.
If you do put together examples based on ID or element scheme XPointer expressions that do return a node in an XML DOM structure, then I would be happy to include them in the set of examples that comes with the XBRLAPI but that work is not a priority for me right now.
I hope that helps some,
Regards
Geoff Shuetrim
Geoff,
Thank you for this explanation.
Does this also mean that ranges like xpointer(range(//title)) are not supported? See
Regards
DDeneer
: http://home.bolink.org/ebooks/xml/xmlnut/ch11_07.htm
You would need to extend the XPointer processor to work with that scheme.
Take a look at org.xbrlapi.xpointer.tests.PointerGrammarTestCase#testElementPointer()
to see how to get access to the parsed parts of the XPointer. What you do with them thereafter is up to you though.