Re: [xml] possibility to use xpath searching on xml balanced chunks

2018-09-05 Thread Pavel Stehule via xml
2018-09-05 12:53 GMT+02:00 Nick Wellnhofer :

> On 05/09/2018 10:53, Pavel Stehule via xml wrote:
>
>> Is any possibility to read balanced chunk in format where XPatch
>> searching is possible?
>>
>
> By design, XPath only works on full documents. All you can do is to insert
> the balanced chunk under a dummy document node.
>

I though it :-(

Thank you for reply.

Regards

Pavel


> Nick
>
>
>
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml


Re: [xml] possibility to use xpath searching on xml balanced chunks

2018-09-05 Thread Nick Wellnhofer

On 05/09/2018 10:53, Pavel Stehule via xml wrote:
Is any possibility to read balanced chunk in format where XPatch searching is 
possible?


By design, XPath only works on full documents. All you can do is to insert the 
balanced chunk under a dummy document node.


Nick


___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml


[xml] possibility to use xpath searching on xml balanced chunks

2018-09-05 Thread Pavel Stehule via xml
Hi

I try to fix one issue of PostgreSQL's implementation of XMLTABLE function.
This is based on libxml2 XPath support and without one issue, it works
perfect.

When the xml document is loaded with function xmlCtxtReadMemory(), then
XPath searching via  xmlXPathCompiledEval functions works great. But
SQL/XML allows to works with XML content only, that can be set of trees.

PostgreSQL uses alternative method for validation -
xmlParseBalancedChunkMemory().

Unfortunately XPath searching doesn't work on document loaded by
xmlParseBalancedChunkMemory() function.

the doc says about xmlCtxtReadMemory - "parse an XML in-memory document and
build a tree. This reuses the existing @ctxt parser context",
xmlParseBalancedChunkMemory - "Parse a well-balanced chunk of an XML
document called by the parser ". There is not any word about "build a
tree". Can be this a problem?

Is any possibility to read balanced chunk in format where XPatch searching
is possible?

Regards

Pavel Stehule
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml