comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » How to IDL to XML using XMLffDOMDocument
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
How to IDL to XML using XMLffDOMDocument [message #51942] Wed, 20 December 2006 10:22 Go to next message
Joan is currently offline  Joan
Messages: 5
Registered: December 2006
Junior Member
Hi,

I'm in a trouble, i am trying to generate xml documents with
IDL-pvwave's object (XMLffDOMDocument),

I have to big 2 problems :

1- my xml is only one big line with all nodes at same line somebody
have some reason¿
2- I generate
oDoc = obj_new('XMLffDOMDocument')
and i can't use AppendChild() on oDoc more than 4 nodes, if i
do this the error is


% IDLFFXMLDOMNODE::APPENDCHILD: DOM Exception: HIERARCHY_REQUEST_ERR:
An
attempt was made to insert a node where it is not
permitted

of course i need more than 4 nodes in xml
Re: How to IDL to XML using XMLffDOMDocument [message #52026 is a reply to message #51942] Thu, 21 December 2006 09:34 Go to previous message
Joan is currently offline  Joan
Messages: 5
Registered: December 2006
Junior Member
Thanks very much,

For first trouble i didn't the keyword /Pretty print of save method and
for the second trouble i can use the IDLffXMLDOMDocumentFragment
subclass of IDLffXMLDOMDocument.

I have used your xml-rpc but i prefer creat the xml than the schema :).

Thx for all
Re: How to IDL to XML using XMLffDOMDocument [message #52038 is a reply to message #51942] Wed, 20 December 2006 19:31 Go to previous message
Robbie is currently offline  Robbie
Messages: 165
Registered: February 2006
Senior Member
If you find XML confusing, you can always use my XML-RPC library to
serialize IDL variables to and from an XML Encoding.

obj = obj_new('rt_xmlrpcfile')
ret = obj -> print( "ouput.xml", value)
ret = obj -> parse( "input.xml", value)

This is great for storing preferences in a text-editable format. Not so
good if you've got a schema you must conform to.

Source code available at
http://www.barnett.id.au/idl/


Robbie
Re: How to IDL to XML using XMLffDOMDocument [message #52041 is a reply to message #51942] Wed, 20 December 2006 12:23 Go to previous message
Karl Schultz is currently offline  Karl Schultz
Messages: 341
Registered: October 1999
Senior Member
On Wed, 20 Dec 2006 10:22:02 -0800, Joan wrote:

> Hi,
>
> I'm in a trouble, i am trying to generate xml documents with
> IDL-pvwave's object (XMLffDOMDocument),
>
> I have to big 2 problems :
>
> 1- my xml is only one big line with all nodes at same line somebody
> have some reason¿

See the PRETTY_PRINT keyword on the IDLffXMLDOMDocument::Save method.

> 2- I generate
> oDoc = obj_new('XMLffDOMDocument')
> and i can't use AppendChild() on oDoc more than 4 nodes, if i
> do this the error is
>
>
> % IDLFFXMLDOMNODE::APPENDCHILD: DOM Exception: HIERARCHY_REQUEST_ERR:
> An
> attempt was made to insert a node where it is not
> permitted
>
> of course i need more than 4 nodes in xml

As the error message suggests, you're trying to add a child node in a way
that does not make sense in XML.

For example, a Document cannot have more than one Element as a direct
child, since there can be only one top-level Element in a Document. You
didn't say what types of nodes you are adding to the Document, so we can't
tell exactly what's wrong. But, I'd guess you are trying to add more than
one Element to the Document. Note that the IDLffXMLDOMDocument object has
a GetDocumentElement method that fetches the one Element that can be a
direct child of the Document.

You probably want to make a top-level Element, and then add other Elements
to that top-level Element as children.

Karl
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: convert decimal -> hexadecimal
Next Topic: Re: convert decimal -> hexadecimal

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 10:56:28 PDT 2025

Total time taken to generate the page: 1.04011 seconds