[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XInclude inconsistency ?

  • From: Philippe Poulard <Philippe.Poulard@s...>
  • To: Elliotte Harold <elharo@m...>
  • Date: Thu, 15 Mar 2007 15:56:22 +0100

Re:  XInclude inconsistency ?
Elliotte Harold wrote:
> Philippe Poulard wrote:
> 
>> I tried my theory on another implementation : I suppose that XOM 
>> passes the test suite (and the [eduni-2] test case), so I just try to 
>> resolve the inclusion on my example ; I just replace the xpointer() 
>> scheme which is not supported by XOM with an equivalent element() 
>> scheme, and I get the result expected, as XOM is certainly implemented 
>> to pass the [eduni-2] test case, it also resolves correctly my test, 
>> but when I replace the xpointer expression to cause a loop exception, 
>> I get the famous infinite loop :
>> Exception in thread "main" java.lang.StackOverflowError
>>
> 
> Just to be clear, you have created documents which generate a stack 
> overflow in XOM, correct?

yes

> 
> If so, I'd appreciate it if you could mail me copies of these documents 
> so I can investigate the problem. Thanks.
> 

of course ; you'll find them in attachment

in xi2-B-include.xml, the expression "element(/1/3)" should cause a loop 
exception but it doesn't, and if you replace it with "element(/1/2)" it 
works fine with XOM (that is to say, the expected document is get)

once again, I'm not sure that it's due to XOM particularly, but rather 
to a design error in XInclude ; if you fix that bug in XOM without 
breaking the test suite (and specifically the test case labelled 
[eduni-2]), it simply prooves that I was wrong and that I really need go 
to sleep :)

my thoughts lead me to this big question : as loops can be detected only 
AFTER applying xpointer expressions (my test), how can they be detected 
if the input must be processed entirely BEFORE applying xpointer 
expressions ([eduni-2] test case) ?
so, after or before ?



here is the snippet java code that thrown the exception :

----------------------------

import java.io.IOException;
import java.io.UnsupportedEncodingException;

import javax.xml.parsers.DocumentBuilderFactory;

import nu.xom.Builder;
import nu.xom.Document;
import nu.xom.ParsingException;
import nu.xom.ValidityException;
import nu.xom.xinclude.BadParseAttributeException;
import nu.xom.xinclude.InclusionLoopException;
import nu.xom.xinclude.NoIncludeLocationException;
import nu.xom.xinclude.XIncludeException;
import nu.xom.xinclude.XIncluder;

public class XIncludeXOMTest {

     public static void main( String[] args ) throws 
BadParseAttributeException, InclusionLoopException, 
NoIncludeLocationException, UnsupportedEncodingException, IOException, 
ParsingException, XIncludeException {
         Builder b = new Builder();
         Document d = b.build( "file:///path/to/xi2-in.xml" );
         System.out.println(XIncluder.resolve( d ).toXML());
     }

}


-- 
Cordialement,

               ///
              (. .)
  --------ooO--(_)--Ooo--------
|      Philippe Poulard       |
  -----------------------------
  http://reflex.gforge.inria.fr/
        Have the RefleX !
<?xml version="1.0" encoding="iso-8859-1"?>
<root xmlns:xi="http://www.w3.org/2001/XInclude">
    <p>Include a part of A that include B that include another part of A</p>
    <A><xi:include href="xi2-A-include.xml" parse="xml" xpointer="element(/1/3)"/></A>
</root>
<?xml version="1.0" encoding="iso-8859-1"?>
<rootA xmlns:xi="http://www.w3.org/2001/XInclude">
    <here>HERE</here>
    <there>there</there>
    <here>here<B><xi:include href="xi2-B-include.xml" parse="xml" xpointer="element(/1/1)"/></B></here>
</rootA>
<?xml version="1.0" encoding="iso-8859-1"?>
<rootB xmlns:xi="http://www.w3.org/2001/XInclude">
    <somewhere>somewhere<A><xi:include href="xi2-A-include.xml" parse="xml" xpointer="element(/1/2)"/></A></somewhere>
</rootB>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.