Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XMLAdapter Load XML ignoring .xsd
Message
De
09/03/2016 11:09:44
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01632680
Message ID:
01632751
Vues:
57
>>>Hi,
>>>
>>>Is it possible to load an XML file into XMLAdapter ignoring the .xsd file defined in the .XML file? For example, the top of the XML looks like this:
>>>
>>>
>>><?xml version="1.0" encoding="utf-8" ?>
>>><EmailList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
>>>	xsi:noNamespaceSchemaLocation="EmailList.xsd" >
>>>
>>>
>>>But I want to load the XML ignoring this EmailList.xsd because XML may have elements NOT defined in the XSD file. Can it be done?
>>>
>>>TIA
>>
>>Ignore inline or referenced schema:
>>
>>m.loXMLAdapter.XMLSchemaLocation = ""
>>
>
>Thank you. But something does not work. I added this line in the following segment:
>
>
>oXMLAdapter = NEWOBJECT('XMLAdapter') 
>oXMLadapter.XMLSchemaLocation = ""
>oXMLadapter.LoadXML( "emaillist.xml", .T.)
>oXMLadapter.Tables.Item(1).ToCursor(.F.,cCursorName)   && this is the line on which error occurs.
>
>
>but then I get error "Index or expression does not match an existing member of the collection"

You said "ignore the schema". That lead VFP to be unable to create a table.
oXMLadapter.LoadXML( "emaillist.xml", .T.)
IF oXMLadapter.Tables.Count = 0
  MESSAGEBOX("No tables were created...")
ELSE
 oXMLadapter.Tables.Item(1).ToCursor(.F.,cCursorName)
ENDIF
Can you provide a sample document with no sensitive information and describe what are you looking after?
----------------------------------
António Tavares Lopes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform