Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Does an XML have to be more than one node?
Message
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Miscellaneous
Thread ID:
01067051
Message ID:
01067777
Views:
15
I do not know that (?xml version="1.0") is not valid - but I do know that XMLMSDOM2.Document seems to only "see" the nodes (tags) when the form is (?xml version="1.0"?)
Try it:
oXML=newObject("Msxml2.DOMDocument")
oXML.async=.f.
cXML=[<?xml version="1.0"><row>This is my row without a question mark</row>]
oXML.loadXML(cXML)
?oXML.childNodes.length && Returns a 0
?oXML.childNodes(0).text && Error: No childnodes
* Now put a question mark in
cXML=[<?xml version="1.0"?><row>This is my row with a question mark</row>]
oXML.loadXML(cXML)
?oXML.childNodes.length && Returns a 2
?oXML.childNodes(0).text && Returns 'version="1.0"'
?oXML.childNodes(1).text && Returns 'This is my row with a question mark'
* Make sure to clear
oXML.abort
release oXML
Does it work? It loads - but it does not address the nodes as configured in this scenario.

>Hi Terry,
>
>I'm sorry...
>
>(translate from translate (en-cs-en) :-) )
>Processing instruction are closed between
>
> <? and ?>
>
>* so <?xml version="1.0"> are not valid XML string
>
>
>
>
>MartinJ
>
>>I try - I try - I note that XML tag should also have a question mark close:
<?xml version="1.0"?>
>>Thanks
>>>Hi Terry,
>>>
>>>Yes, your XML construct is right.
>>>
>>> The basic rules...
>>>- XML must has header: (?xml ...)
>>>- DTD declaration if you need
>>>- and one master element
>>>
>>>MartinJ
>>>
>>>
>>>>There's no rule that says XML encapsulation requires more than one open and close tag, right?
>>>>
>>>>So one could construct an XML thusly;
>>>><?xml version="1.0"><mydata> ... a couple of thousand character string ..</mydata>
Right?
>>>>
>>>>Thanks
Imagination is more important than knowledge
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform