Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Msxml-questions
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Titre:
Divers
Thread ID:
00822934
Message ID:
00823478
Vues:
24
>Hi Simon,
>
>thank you very, very much for your code.
>Could you also tell me, how to create document-type node for the DTD.
>I haven't found a hint in the xml-help-file which says that I can't create a documenttype-node with the createnode-method.
>
>Thanks in advance
>
>Thomas

You can't create a node of NODE_DOCUMENT_TYPE. MXSML is not appropriate for creating a standalone DTD and I would simply create it as a string and save to file. So, I assume this is an inline DTD? If so, I would create it like so:
LOCAL lcXML AS String, loXML as MSXML2.DomDocument

TEXT TO lcXML TEXTMERGE NOSHOW PRETEXT 3
  <?xml version="1.0"?>
  <!DOCTYPE foo [ <!ELEMENT foo (#PCDATA)> ]>
  <!-- More DTD stuff goes here -->
  <!-- Add XML nodes here... -->
ENDTEXT

** ...Or here
lcXML = lcXML + "<foo>bar</foo>"

loXML = CREATEOBJECT("MSXML.DomDocument")
loXML.validateOnParse = .F.
IF loXML.loadXML(lcXML)
  ** ...Or here
ELSE
  MESSAGEBOX(loXML.parseError.reason)
ENDIF
Also, I would strongly suggest that you switch to XML schemas instead: it's XML(!), it supports more data types, and you can validate more complex structures.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform