Dear Hussein,

problem is fixed, include is now running via xi:include.

Thanks a lot

Stefan




-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Hussein Shafie
Gesendet: Mittwoch, 28. April 2010 19:53
An: [email protected]
Cc: [email protected]
Betreff: Re: [XXE] Trouble with XML-Schema and XInclude

In HyGF2010Zeitschriften.xsd, I've replaced:
---
<xs:import namespace="http://www.w3.org/XML/1998/namespace";
schemaLocation="http://www.w3.org/XML/1998/namespace"/>
---
by
---
<xs:import namespace="http://www.w3.org/XML/1998/namespace";
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
---

After doing that, everything works fine for me. I used xmltool[*] to
validate your schemas and your documents. I ran:

---
xmltool validate -s HyGF2010Zeitschriften.xsd
---
OK!

---
xmltool validate -s HyGF2010Zeitschriften.xsd HyGF2010Zeitschriften.xml
---
OK!

---
xmltool validate -s HyGF2010Literatur.xsd
---
OK!

---
xmltool validate -s HyGF2010.xsd
---
OK!

and finally:

---
xmltool validate -s HyGF2010.xsd -xi HyGF2010Test.xml
---
OK!

Without the -xi option (which means: transclude[**] xinc:include
elements), I indeed have:
---
xmltool validate -s HyGF2010.xsd  HyGF2010Test.xml

ERROR: file:/home/hussein/tmp/HyGF2010Test.xml:20:16:Invalid Structure:
thesequence of child elements is incorrect [cvc-complex-type.2.4]

ERROR: file:/home/hussein/tmp/HyGF2010Test.xml:20:16:Invalid Structure:
element cannot contain element "xinc:include" [cvc-complex-type]
---
which is normal because the schema does not allow lit:Artikel to contain
xinc:include.

Now if I open HyGF2010Test.xml in XXE, I have the same validation
errors, which is normal.

To remove them, I need to either:

* Modify the grammar to allow xinc:include in elements like lit:Artikel

OR

* tell XXE to transclude xinc:include elements by creating an XXE
configuration. More information in
http://www.xmlmind.com/xmleditor/_distrib/doc/configure/index.html

In summary, apart the
schemaLocation="http://www.w3.org/XML/1998/namespace";, I see nothing
wrong in what you did.



---
[*] xmltool is found in XXE_install_dir/bin/. More information in
http://www.xmlmind.com/xmleditor/_distrib/doc/xmltool/index.html

[**] transclude = replace the xinc:include by the contents pointed to.



Stefan Klatt  wrote:
> 
> http://www.sagehill.net/docbookxsl/ValidXinclude.html for the topic
(you`ll
> surely know) in the "DTD Version".
> 
> I enclose our little project as a rar. -- "Zeitschriften" means
"journals". 
> 
> The goal of this example (our students are asked to create something like
> this and learn about namespaces) is to construct a local file with content
> and (a register of) literatur (<Artikel> = <article> and other stuff) 
> 
> The local storage (HyGF2010Test.xml) of additional journal informations as
> well as from the external source (HyGF2010Zeitschriften.xml) shall be
> allowed in a uniform format (via HyGF2010Zeitschriften.xsd).
> 
> Within the second article, the 
> 
> <xinc:include href="HyGF2010Zeitschriften.xml" xpointer="z1000"/> 
> 
> generates the "base" attribute (according to w3c) within <Eintrag> =
<entry>
> in the moment of validation, so I integrated the "xml:-Namespace" and
> allowed the attribute.
> 
> Works fine in Xml Spy. ... and so the trouble starts ....
> 


 
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

 
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to