[xsd-users] question regarding to xsd:any

Boris Kolpackov boris at codesynthesis.com
Thu Apr 6 04:25:10 EDT 2006


Hi Oliver,

Please do not send questions about xsd to me directly. Instead
send them to the xsd-users mailing list so others can benefit
from this information. I am forwarding your original message
to the list and will reply to that.

thanks,
-boris


----- Forwarded message from Oliver.Kowalke at infineon.com -----

From: Oliver.Kowalke at infineon.com
Subject: question regarding to xsd:any
Date: Thu, 6 Apr 2006 09:36:58 +0200
Message-ID: <5D4F031442F5CB489CF88277DDBACCDD04684674 at drsse401.eu.infineon.com>
To: boris at codesynthesis.com

Hello Boris,
I'm using xsd.any in hello.xsd in order to embed another xml document.
Node 'c' contains the additional xml nodes (in other namespace).
How can I access the content of node c?

abc::a_type a_n(
* abc::a(
		path_,
		xml_schema::flags::keep_dom |
xml_schema::flags::dont_initialize) );

abc::b_type & b_n = a_n.b();
abc::c_type & c_n = b_n.c();
xercesc::DOMNode * c = c_n._node();
if ( ! c)
	throw std::runtime_error("pointer to DOMNode c is null");

xercesc::DOMNode * embed = c->getFirstChild();
if ( ! embed)
	throw std::runtime_error("pointer to DOMNode embed is null ");

std::cout << xml::transcode< char >( w->writeToString( * embed) ) <<
std::endl;	// prints nothing
std::cout << xml::transcode< char >( embed ->getNodeValue() ) <<
std::endl; // prints nothing
std::cout << xml::transcode< char >( embed ->getTextContent() ) <<
std::endl; // prints nothing

Is it possible to create C++ classes from the schema of embed.xml and
initialize it with the DOMNode returned from c->getFirstChild()?

What is your suggestion?

With best regards and thanks for your xsd-tool!

Oliver

----- End forwarded message -----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060406/d43b9226/attachment.pgp


More information about the xsd-users mailing list