Skip to content
This repository has been archived by the owner on Apr 29, 2023. It is now read-only.

XInclude processing #126

Open
hcw70 opened this issue Jul 8, 2020 · 3 comments
Open

XInclude processing #126

hcw70 opened this issue Jul 8, 2020 · 3 comments

Comments

@hcw70
Copy link

hcw70 commented Jul 8, 2020

Dear authors of pyxb.

I need to process a XML document which is assembled from others by means of XInclude.
LibXML and python seems to handle that, but via PyXB it does not seem to work:

<?xml version="1.0" encoding="UTF-8"?>
<MessageDB xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xxx.de/config/xxx msgdb/xsd/MessageDB.xsd"
    xmlns="http://xxx.de/config/xxx"
    xmlns:xi="http://www.w3.org/2001/XInclude">
    
    <xi:include href="MessageDB-Example-lib.xml"/>
    
    <module name="MotivatinExample1">
   </module>
 </MessageDB>

gives:


  File "/home/hcw/work/Deuta/xxx/venv/lib/python3.7/site-packages/pyxb/binding/basis.py", line 2567, in append
    raise pyxb.UnrecognizedContentError(self, self.__automatonConfiguration, value, location)
pyxb.exceptions_.UnrecognizedContentError: Invalid content include at <unknown>[7:4] (expect {http://xxx.de/config/xxx}doc or {http://xxx.de/config/xxx}altName or {http://xxx.de/config/xxx}module)

Any hints on this?

@pabigot
Copy link
Owner

pabigot commented Jul 8, 2020

http://www.w3.org/2001/XInclude is not supported by PyXB. You would have to preprocess the document to incorporate the included material.

@hcw70
Copy link
Author

hcw70 commented Jul 8, 2020

But isnt it using lxml? Then why not simply do like

https://lxml.de/1.3/api.html#xinclude-and-elementinclude
?

Or via ElementTree

http://effbot.org/zone/element-xinclude.htm

?

@pabigot
Copy link
Owner

pabigot commented Jul 8, 2020

Because #100.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants