Hi
Does anyone know how to extract an entire structure from a DOM tree
and return the structure in XML format in a char *.
For example:
For the following XML document:
char *sDoc = new char[512];
strcpy(sDoc,
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<!DOCTYPE Struct"
"["
"<!ELEMENT Struct (Tag, Test)>"
"<!ELEMENT Tag (#PCDATA)>"
"<!ELEMENT Test (Choc*)>"
"<!ELEMENT Choc (#PCDATA)>"
"<!ATTLIST Struct StructAtt (Att1 | Att2)
\"Att2\">"
"]>"
"<Struct StructAtt=\"Att1\">"
" <Tag>Field</Tag>"
" <Test>"
" <Choc>snow flake</Choc>"
" <Choc>prism</Choc>"
" </Test>"
"</Struct>"
);
A call like
char *str = GetStructure("Test");
should return
<Test>
<Choc>snow flake</Choc>
<Choc>prism</Choc>
</Test>
in the char pointer str.
Regards.
Ideshini.
P.S. I have tried using the DOMPrint program to achieve this by substituting
an ostrstream buffer
for the cout stream. That does not seem to work.
This e-mail may contain confidential information and may be legally
privileged and is intended only for the person to whom it is addressed. If
you are not the intended recipient, you are notified that you may not use,
distribute or copy this document in any manner whatsoever. Kindly also
notify the sender immediately by telephone, and delete the e-mail. When
addressed to Internet Solutions' clients any opinion or advice contained in
this e-mail is subject to the terms and conditions expressed in any
applicable terms of business or client engagement letter. Internet
Solutions does not accept liability for any damage, loss or expense arising
from this e-mail and/or from the accessing of any files attached to this
e-mail.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]