Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Schema Validation
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Versions des environnements
Visual FoxPro:
VFP 8
OS:
Windows XP SP1
Database:
Visual FoxPro
Divers
Thread ID:
00988563
Message ID:
00989261
Vues:
53
Do you know anything about the "#text" node type?
For example, when mapping the DOMed XML to a treeview (example:)
<item identifier="INTRO" identifierref="RESOURCE_INTRO">
      <title>Introduction</title>
</item>
The treeview looks something like this:
+Node: Item INTRO
    + Node: Title Introduction
    + Attrib: identifierref RESOURCE INTRO
       +Node #text Introduction
I have code to filter the #text (node) out - but it is a nusiance. Is there a DOM function I can use to prohibit "#text" node types from showing up. Where do they come from, anyway?:)


For example, when I map the "loaded" XML

>Hi,
>
>>>
>I use DOM methods to crawl through the XML to assure that the required node and attributes are in the package. There is usually an expectation of what should be in the package.
>
>What does the DOM Validate method do?
>>>
>
>Pretty much the same thing <s>. You can either validate an XMLDocument against a scheme when it is loaded by setting the .validateOnParse property(VB example from documentation:)
>
>
>Dim xmlDoc As New Msxml2.DOMDocument30
>xmlDoc.async = False
>xmlDoc.validateOnParse = True
>xmlDoc.Load "books.xml"
>If (xmlDoc.parseError.errorCode <> 0) Then
>   Dim myErr
>   Set myErr = xmlDoc.parseError
>   MsgBox("You have error " & myErr.reason)
>End If
>
>
>or achieve the same thing after loading with:
>
>
>Dim xmlDoc As New Msxml2.DOMDocument30
>xmlDoc.async = False
>xmlDoc.Load "books.xml"
>xmlDoc.Validate
>If (xmlDoc.parseError.errorCode <> 0) Then
>   Dim myErr
>   Set myErr = xmlDoc.parseError
>   MsgBox("You have error " & myErr.reason)
>End If
>
>
>The benefit of the later is that you can load the doc, add/change nodes and validate the modified result.
>
>Regards,
>Viv
Imagination is more important than knowledge
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform