Hi Mike,
Sorry for the late reply.
declare namespace asy="http://xml.acme.com/asy"; declare variable $part external; insert nodes $part as first into db:open("PARTDB")/asy:assembly[@name="ZB09010"]
The characters in the xs:string $path reserved for XML e.g. < > etc are converted to < > etc and the insert silently fails.
Just to be sure: Does it really 'fail' (e.g. by showing some errors), or is your XML input added as a string (which will then be output with < and > encoded as < and >)?
if I change the insert statement to :
insert nodes fn:parse-xml($part) as first into db:open("PARTDB")/asy:assembly[@name="ZB09010"]
I get the message
FODC0006 (Line 1): The prefix "asy" for element "asy:part" is not bound.
I guess your XML input did not contain an xmlns:asy namespace declaration? Without the declaration, it won’t be possible to parse it as well-formed XML input.
declare namespace asy="http://xml.acme.com/asy"; at the beginning of the $path variable contents before the XML I get FODC0006 (Line 1): Content is not allowed in prolog.
I’m not sure how to reproduce this one. If my comment above doesn’t help, feel free to provide with an example.
Hope this helps, Christian