[xsd-users] RE: Problem getting code to read data from files
including using XInclude
Tim Muirhead
Tim.Muirhead at tibra.com
Tue Jul 21 14:46:04 EDT 2009
Hi,
I have followed Boris's advice and modified the sample program taken from examples/cxx/tree/multiroot
It now compiles but when I run it with the following set to true
conf->setParameter(XMLUni::fgXercesDoXInclude, true);
It will give a runtime error
test.xml:9:53 error: no scheme found in URI
This only occurs when trying to include the file
<TestComplex>
<xin:include href="testRef.xml" />
</TestComplex>
It is definitely picking up the correct file - as if you put in a invalid file name you get an 'unable to include resource 'bogusfile.xml'
Also, the testRef.xml file appears valid.
Any help would be greatly appreciated.
Example files included as xsdTest2.zip
Thanks
Tim Muirhead
From: Tim Muirhead
Sent: Wednesday, 15 July 2009 16:28
To: 'xsd-users at codesynthesis.com'
Subject: Problem getting code to read data from files including using XInclude
Hi,
I've been trying to get a simple example using xinclude to work and am wondering if someone can assist. I'm using xsd-3.2.0 and xerces 3.0.1,
I've created an xsd schema that allows a choice between including a section of config directly, or including it from an another file. The example program (xmlval.cpp) then tries to read and print data. When I try and use an included file, it currently fails. It knows that that the file has been included, but perhaps I missing a step (like explicitly parsing the included file?) I haven't been able to find any examples on the web that show how xinclude works from the xsd to the code stage - so I created 4 simple files to demonstrate the usage of xinclude:
These are
test.xsd
test.xml - the main xml
testRef.xml - the 'included' xml
xmlval.cpp - trys to read and print the data.
(You can uncomment the section in test.xml to run the case when it is specifying it directly and not using xinclude)
Any help would be greatly appreciated.
Best regards
Tim Muirhead
The contents of this email including any attachments are confidential. If you have received this email in error, please advise the sender by return email and delete this email. Any unauthorised use of the contents of the email is prohibited and you must not disseminate, copy or distribute the message or use the information contained in the email or its attachments in any way.
The views or opinions expressed are the author's own and may not reflect the views or opinions of Tibra. Tibra does not guarantee the integrity of any emails or attached files. E-mails may be interfered with, may contain computer viruses or other defects. Under no circumstances do we accept liability for any loss or damage which may result from your receipt of this message or any attachments.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xsdTest2.zip
Type: application/x-zip-compressed
Size: 5136 bytes
Desc: xsdTest2.zip
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20090721/64a39882/xsdTest2.bin
More information about the xsd-users
mailing list