Page 1 of 1

Oxygen unable to deal with empty tags when doing XInclude

Posted: Wed Sep 13, 2006 11:52 am
by michaelwk
Hi,

I've a file containing empty tags. I want to include it in another XML using XInclude. Everything works until processor found an empty tag like this <test/>. All tags that follows this are included but without the values. Example <hello>lalala</hello> become <hello></hello>.
Changing <test/> by <test></test> solve the problem but I don't want to do this everywhere.

Further more, I can't validate my result file which contains the <xi:include> tags. I use .XSD
scheme, and i don't want to transform it to allow other kind of tags.

regards,
michael

Posted: Wed Sep 13, 2006 1:16 pm
by sorin_ristache
Hello,

Can you post sample files for reproducing the error and the result that you get after resolving the XInclude elements ? In a simple test that I did the XInclude elements are resolved correctly if the XML document is well-formed. It is not necessary to be valid. What do you mean by result file that contains <xi:include> tags ? How do you obtain this result file ? Anyway if you want to validate it the include element of the XInclude namespace must be declared in the schema. The current version of the XML parser does not accept it without being declared.

Regards,
Sorin

Posted: Wed Sep 13, 2006 2:49 pm
by sorin_ristache
Sorry, if you validate against an XML Schema you do not need to declare the elements of the XInclude namespace (include, fallback) in your schema. Just enable XInclude processing in <oXygen/> from Options -> Preferences -> XML / XML Parser -> Enable XInclude processing and the Validate Document action will resolve correctly xi:include elements. You need to declare the include and fallback elements only if you validate against DTD.

Regards,
Sorin

Posted: Wed Sep 13, 2006 5:08 pm
by michaelwk
for example these 2 file (XSD, XSL are removed)

_blank.xml:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<test>
<document/>
<fs>
<f>
<name>LAlalalalalallalalalla will appear in result</name>
<xml-page/>
<bundle>
<name>XMLpage is an empty tag ang this text will never appear in result</name>
</bundle>
</f>
</fs>
</test>
and tests.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<test xmlns:xi="http://www.w3.org/2001/XInclude">
<document/>
<f>
<xi:include href="_blank.xml" xpointer="element(/1/2/1)">
<xi:fallback>404</xi:fallback>
</xi:include>
</f>
</test>
result is :

Code: Select all

<test> <document></document> <f>  <f>  <name>LAlalalalalallalalalla will appear in result</name>  <xml-page></xml-page><bundle><name></name></bundle></f>  </f> </test>
you can see the text in <name> diseapear !

Regards,
Michael

Posted: Wed Sep 13, 2006 5:12 pm
by michaelwk
if in _blank.xml i change <xml-page/> by <xml-page></xml-page>, i've :

Code: Select all

<test> <document></document> <f>  <f>  <name>LAlalalalalallalalalla will appear in result</name>  <xml-page></xml-page>  <bundle>  <name>XMLpage is an empty tag ang this text will never appear in result</name>  </bundle>  </f>  </f> </test>
Regards,
Michael

Posted: Thu Sep 14, 2006 12:27 pm
by sorin_ristache
Hello,

I reported the bug to the developers of the XInclude processor. Also we will try to fix the bug in <oXygen/> independent of the XInclude processor developers. You have to use the workaround that you found until the bug is fixed: use <xml-page></xml-page> instead of <xml-page/> in _blank.xml.


Thank you for your report,
Sorin

Re: Oxygen unable to deal with empty tags when doing XInclude

Posted: Fri Mar 20, 2009 4:16 pm
by sorin_ristache
Hello,
michaelwk wrote:I've a file containing empty tags. I want to include it in another XML using XInclude. Everything works until processor found an empty tag like this <test/>. All tags that follows this are included but without the values. Example <hello>lalala</hello> become <hello></hello>.
Changing <test/> by <test></test> solve the problem but I don't want to do this everywhere.
We fixed the problem in a previous version (version 8.2). You can try the latest version from the Download page.


Regards,
Sorin