Next in thread →
Next in month →
Re: [xml-dev] 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 !
Next in thread →
Next in month →