www.webdeveloper.com
Results 1 to 2 of 2

Thread: XML Parser for xml files of Infopath

  1. #1
    Join Date
    May 2012
    Posts
    2

    XML Parser for xml files of Infopath

    I have an xml file extracted from microsoft infopath like below:

    <?xml version="1.0" encoding="UTF-8"?><?mso-infoPathSolution name="urn:schemas-microsoft-comffice:infopathepartureReport:-myXSD-2009-11-25T09-12-35" solutionVersion="1.0.0.27" PIVersion="1.0.0.0" href="file:///C:\Documents%20and%20Settings\kaperonis\Desktop\DepartureReport.xsn" productVersion="12.0.0" ?><?mso-application progid="InfoPath.Document"?>
    <my:myFields xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-11-25T09:12:35" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003" xml:lang="en-us">
    <my:txtaaaa>My name</my:txtaaaa>
    <my:txtbbbb>A place</my:txtbbbb>
    <my:txtcccc>Number</my:txtcccc>
    <my:intyyyy>Date</my:intyyyy>
    <my:txtgggg>20</my:txtgggg>
    <my:txtqwqw>TEST TEST</my:txtqwqw>
    .....
    .....
    ....
    ...

    i made an xsd file like this one:

    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/office/...11-25T09:12:35" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="myFields">
    <xs:complexType>
    <xs:sequence>
    <xs:element type="xs:string" name="txtaaaa"/>
    <xs:element type="xs:string" name="txtbbbb"/>
    <xs:element type="xs:byte" name="txtcccc"/>
    <xs:element type="xs:short" name="intyyyy"/>
    <xs:element type="xs:string" name="txtgggg"/>
    <xs:element type="xs:string" name="txtqwqw"/>
    .....
    .....
    ....

    The validation test returns an error:

    DOMDocument::schemaValidate() Generated Errors!
    Error 1845: Element '{http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-11-25T09:12:35}myFields': No matching global declaration available for the validation root. in file:///C:/xxxx/xxxx/xxxxx/xxxxx/xxxxx.xml on line 2

    I have confused...is something not compatible for infopath xml files in php? I have tested with other files (web examples) and the parser works properly....any help would be appreciated.....

  2. #2
    Join Date
    May 2012
    Posts
    2
    Sorry Guys my mistake.....

    The error is

    Error 3036: Element '{http://www.w3.org/2001/XMLSchema}complexType': The attribute 'name' is required but missing. in file:///C:/xampp/htdocs/alestel/images/departure.xsd on line 2

    XSD file is:

    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-11-25T09:12:35" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType>
    <xs:sequence>
    <xs:element type="xs:string" name="txtaaaa"/>
    <xs:element type="xs:string" name="txtbbbb"/>
    <xs:element type="xs:byte" name="txtcccc"/>
    <xs:element type="xs:short" name="txtgggg"/>
    <xs:element type="xs:string" name="txtqwqw"/>
    .....
    .....

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles