Special charecters handling while Converting XML string to DOM

Hi,
I am using the following approach for converting XML string to DOM, but due to Special characters like "&", I am getting Exceptions:
String xmlString;
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(new InputSource(new StringReader(xmlString)));
Can anyone please help me out on how to handle the Special characters in the above code.

If the XML doesn't parse, then the XML must be invalid. Show a sample of such a special character in the XML data. Please use \ tags to post the actual XML content and any other code.                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Convert XML string into DOM

    Hi all,
    I have a question here regarding converting XML string into a DOM document.
    How can I do this in Java?
    The Document.Parse() methods do not have one that takes in String as its parameter.
    I'm not sure what is the best way to do this in Java.
    Any help is greatly appreciated.
    Thank you in advance.
    regards,
    Sean

    Convert XML String to Document with StringReader.
    String xmlString;
    DocumentBuilderFactory factory =
                DocumentBuilderFactory.newInstance();
                DocumentBuilder builder = factory.newDocumentBuilder();
       Document         document = builder.parse(new InputSource(new StringReader(xmlString)));

  • Getting error while converting xml to xsd

    I am getting error"The table (citeinfo) cannot be the child table to itself in nested relations"
    at "http://www.flame-ware.com/products/xml-2-xsd/Default.aspx", while converting
    xml into xsd so i can register.
    Wherever citeinfo is there it is giving error.
    Please look at bold and suggest solution
    thank you
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE metadata SYSTEM "http://www.fgdc.gov/metadata/fgdc-std-001-1998.dtd">
    <metadata>
    <idinfo>
    <citation>
    *<citeinfo>(1)*<origin>MRF</origin>
    <pubdate>20040512</pubdate>
    <pubtime>09000000</pubtime>
    <title>BAS_EASEMENT</title>
    <edition>1</edition>
    <geoform>vector digital data</geoform>
    <serinfo>
    <sername>One</sername>
    <issue>One</issue>
    </serinfo>
    <pubinfo>
    <pubplace>San Jose</pubplace>
    <publish>CITY</publish>
    </pubinfo>
    <othercit>None</othercit>
    <onlink>www.mrf.com</onlink>
    <lworkcit>
    *<citeinfo>(2)*<pubdate>20040512</pubdate>
    <pubtime>09000000</pubtime>
    <edition>1</edition>
    <geoform>vector digital data</geoform>
    <serinfo>
    <sername>One</sername>
    <issue>One</issue>
    </serinfo>
    <pubinfo>
    <pubplace>San Jose</pubplace>
    <publish>CITY</publish>
    </pubinfo>
    <othercit>None</othercit>
    <onlink>www.mrf.com</onlink>
    *</citeinfo>(2)*</lworkcit>
    *</citeinfo>(1)*</citation>
    <descript>
    <abstract>Easement</abstract>
    <purpose>E911 System</purpose>
    <supplinf>None</supplinf>
    </descript>
    <timeperd>
    <timeinfo>
    <sngdate>
    <caldate>20040512</caldate>
    <time>09000000</time>
    </sngdate>
    </timeinfo>
    <current>publication date</current>
    </timeperd>
    <status>
    <progress>Complete</progress>
    <update>As needed</update>
    </status>
    <spdom>
    <bounding>
    <westbc>
    -122.339</westbc>
    <eastbc>
    -121.0716</eastbc>
    <northbc>
    37.4900</northbc>
    <southbc>
    36.9086</southbc>
    </bounding>
    </spdom>
    <keywords>
    <theme>
    <themekt>Easement</themekt>
    <themekey>Easement</themekey>
    </theme>
    <place>
    <placekt>San Jose</placekt>
    <placekey>San Jose</placekey>
    </place>
    <stratum>
    <stratkt>None</stratkt>
    <stratkey>None</stratkey>
    </stratum>
    <temporal>
    <tempkt>None</tempkt>
    <tempkey>None</tempkey>
    </temporal>
    </keywords>
    <accconst>None</accconst>
    <useconst>None</useconst>
    <ptcontac>
    <cntinfo>
    <cntperp>
    <cntper>Earl Harris</cntper>
    <cntorg>City of San Jose</cntorg>
    </cntperp>
    <cntpos>Project Manager</cntpos>
    <cntaddr>
    <addrtype>Actual Address</addrtype>
    <address>801 N 1 ST</address>
    <city>San Jose</city>
    <state>CA</state>
    <postal>90000</postal>
    <country>USA</country>
    </cntaddr>
    <cntvoice>408.277.5626</cntvoice>
    <cnttdd>408.277.5626</cnttdd>
    <cntfax>408.298.8382</cntfax>
    <cntemail>[email protected]</cntemail>
    <hours>9-5</hours>
    <cntinst>None</cntinst>
    </cntinfo>
    </ptcontac>
    <browse>
    <browsen>None</browsen>
    <browsed>None</browsed>
    <browset>None</browset>
    </browse>
    <datacred>Unknown</datacred>
    <secinfo>
    <secsys>FGDC</secsys>
    <secclass>Confidential</secclass>
    <sechandl>Confidential Information</sechandl>
    </secinfo>
    <native>Microsoft Windows NT Version 4.0 (Build 1381) Service Pack 6; ESRI ArcCatalog 8.3.0.800</native>
    <crossref>
    *<citeinfo>(3)*<origin>MRF</origin>
    <pubdate>20040512</pubdate>
    <pubtime>09000000</pubtime>
    <title>BAS_EASEMENT</title>
    <edition>1</edition>
    <geoform>vector digital data</geoform>
    <serinfo>
    <sername>one</sername>
    <issue>one</issue>
    </serinfo>
    <pubinfo>
    <pubplace>San Jose</pubplace>
    <publish>CITY</publish>
    </pubinfo>
    <othercit>None</othercit>
    <onlink>www.mrf.com</onlink>
    <lworkcit>
    *<citeinfo>(*4)
    <origin>MRF</origin>
    <pubdate>20040512</pubdate>
    <pubtime>09000000</pubtime>
    <title>BAS_EASEMENT</title>
    <edition>1</edition>
    <geoform>vector digital data</geoform>
    <serinfo>
    <sername>one</sername>
    <issue>one</issue>
    </serinfo>
    <pubinfo>
    <pubplace>San Jose</pubplace>
    <publish>CITY</publish>
    </pubinfo>
    <othercit>None</othercit>
    <onlink>www.mrf.com</onlink>
    *</citeinfo>(*3)
    </lworkcit>
    *</citeinfo*>(4)
    </crossref>
    </idinfo>
    <dataqual>
    <attracc>
    <attraccr>All the related attributes are populated 100%.</attraccr>
    <qattracc>
    <attraccv>100%</attraccv>
    <attracce>All the related attributes are populated 100%.</attracce>
    </qattracc>
    </attracc>
    <logic>100% adjusted,modified and captured easements.</logic>
    <complete>100%</complete>
    <posacc>
    <horizpa>
    <horizpar>Easement accuracy is 2 ft for 3" pixel Orthophoto, 5 ft for 9" pixel Orthophoto.</horizpar>
    <qhorizpa>
    <horizpav>2 ft for 3" pixel Orthophoto, 5 ft for 9" pixel Orthophoto.</horizpav>
    <horizpae>Easement accuracy is 2 ft for 3" pixel Orthophoto, 5 ft for 9" pixel Orthophoto.</horizpae>
    </qhorizpa>
    </horizpa>
    <vertacc>
    <vertaccr>Easement accuracy is 2 ft for 3" pixel Orthophoto, 5 ft for 9" pixel Orthophoto.</vertaccr>
    <qvertpa>
    <vertaccv>2 ft for 3" pixel Orthophoto, 5 ft for 9" pixel Orthophoto.</vertaccv>
    <vertacce>Easement accuracy is 2 ft for 3" pixel Orthophoto, 5 ft for 9" pixel Orthophoto.</vertacce>
    </qvertpa>
    </vertacc>
    </posacc>
    <lineage>
    <srcinfo>
    <srccite>
    <*citeinfo>(5)*<origin>MRF</origin>
    <pubdate>20040512</pubdate>
    <pubtime>09000000</pubtime>
    <title>BAS_EASEMENT</title>
    <edition>1</edition>
    <geoform>vector digital data</geoform>
    <serinfo>
    <sername>one</sername>
    <issue>one</issue>
    </serinfo>
    <pubinfo>
    <pubplace>San Jose</pubplace>
    <publish>CITY</publish>
    </pubinfo>
    <othercit>None</othercit>
    <onlink>www.mrf.com</onlink>
    <lworkcit>
    *</citeinfo>(5*)*<citeinfo>(6)*
    <origin>MRF</origin>
    <pubdate>20040512</pubdate>
    <pubtime>09000000</pubtime>
    <title>BAS_EASEMENT</title>
    <edition>1</edition>
    <geoform>vector digital data</geoform>
    <serinfo>
    <sername>one</sername>
    <issue>one</issue>
    </serinfo>
    <pubinfo>
    <pubplace>San Jose</pubplace>
    <publish>CITY</publish>
    </pubinfo>
    <othercit>None</othercit>
    <onlink>www.mrf.com</onlink>
    *</citeinfo>(5)*
    </lworkcit>
    *</citeinfo>(6)*
    </srccite>
    <srcscale>24000</srcscale>
    <typesrc>FTP</typesrc>
    <srctime>
    <timeinfo>
    <sngdate>
    <caldate>20040512</caldate>
    <time>09000000</time>
    </sngdate>
    </timeinfo>
    <srccurr>publication date</srccurr>
    </srctime>
    <srccitea>Unknown</srccitea>
    <srccontr>MGE dgn contains easement data.</srccontr>
    </srcinfo>
    <procstep>
    <procdesc>Easement data is reprojected from NAD27 to NAD83.
    Further it is adjusted as per the spatial alignment shown in MGE input dgn.</procdesc>
    <srcused>Easement</srcused>
    <procdate>20040512</procdate>
    <proctime>09000000</proctime>
    <srcprod>BAS_EASEMENT</srcprod>
    <proccont>
    <cntinfo>
    <cntperp>
    <cntper>Mahesh P Choudhury</cntper>
    <cntorg>Rolta International Inc.</cntorg>
    </cntperp>
    <cntpos>Project Manager</cntpos>
    <cntaddr>
    <addrtype>mailing address</addrtype>
    <address>5865 North Point Parkway</address>
    <city>Alpharetta</city>
    <state>GA</state>
    <postal>30022</postal>
    <country>USA</country>
    </cntaddr>
    <cntvoice>678.942.5015</cntvoice>
    <cnttdd>678.942.5015</cnttdd>
    <cntfax>678.942.5001</cntfax>
    <cntemail>[email protected]</cntemail>
    <hours>8-5</hours>
    <cntinst>None</cntinst>
    </cntinfo>
    </proccont>
    </procstep>
    </lineage>
    <cloud>Unknown</cloud>
    </dataqual>
    <spdoinfo>
    <indspref>unknown</indspref>
    <direct>Vector</direct>
    <ptvctinf>
    <sdtsterm>
    <sdtstype>String</sdtstype>
    <ptvctcnt>2203</ptvctcnt>
    </sdtsterm>
    </ptvctinf>
    </spdoinfo>
    <spref>
    <horizsys>
    <geograph>
    <latres>5.5</latres>
    <longres>5.5</longres>
    <geogunit>Decimal degrees</geogunit>
    </geograph>
    <geodetic>
    <horizdn>North American Datum of 1983</horizdn>
    <ellips>Geodetic Reference System 80</ellips>
    <semiaxis>1</semiaxis>
    <denflat>2</denflat>
    </geodetic>
    </horizsys>
    <vertdef>
    <altsys>
    <altdatum>North American Vertical Datum of 1988</altdatum>
    <altres>0.002</altres>
    <altunits>sf</altunits>
    <altenc>Attribute values</altenc>
    </altsys>
    <depthsys>
    </depthsys>
    </vertdef>
    </spref>
    <eainfo>
    <detailed>
    <enttyp>
    <enttypl>
    BAS_EASEMENT</enttypl>
    <enttypd>Contains geometry and attributes for easement segments</enttypd>
    <enttypds>Data Model Dictionary</enttypds>
    </enttyp>
    <attr>
    <attrlabl>BAS_EASEMENT_ID</attrlabl>
    <attrdef>Migrated from STREET table ID column. After all the existing IDs have been migrated, assign ID #70,001 onwards for the new easement (or what ever # is available sequentially using, street centerline #) ID's.</attrdef>
    <attrdefs>ESRI</attrdefs>
    <attrdomv>
    <udom>Sequential unique whole numbers that are automatically generated.</udom>
    </attrdomv>
    <begdatea>20040512</begdatea>
    <enddatea>20040512</enddatea>
    <attrvai>
    <attrva>100</attrva>
    <attrvae>Unknown</attrvae>
    </attrvai>
    <attrmfrq>As needed</attrmfrq>
    </attr>
    <attr>
    <attrlabl>SURVEY_LENGTH</attrlabl>
    <attrdef>Actual length of easement (international foot).This DOES take into account the State Plane Coordinate System.</attrdef>
    <attrdefs>Data Model Dictionary</attrdefs>
    <attrdomv>
    <udom>Surveyed segment length</udom>
    </attrdomv>
    <begdatea>20040512</begdatea>
    <enddatea>20040512</enddatea>
    <attrvai>
    <attrva>100</attrva>
    <attrvae>Unknown</attrvae>
    </attrvai>
    <attrmfrq>As needed</attrmfrq>
    </attr>
    <attr>
    <attrlabl>ROW_WIDTH</attrlabl>
    <attrdef>Width of right-of-way (international feet)</attrdef>
    <attrdefs>Data Model Dictionary</attrdefs>
    <attrdomv>
    <udom>Right-of-way width</udom>
    </attrdomv>
    <begdatea>20040512</begdatea>
    <enddatea>20040512</enddatea>
    <attrvai>
    <attrva>100</attrva>
    <attrvae>Updated from ROW files</attrvae>
    </attrvai>
    <attrmfrq>As needed</attrmfrq>
    </attr>
    <attr>
    <attrlabl>FROM_EASEMENT_ID</attrlabl>
    <attrdef>Self-referential key to BAS_EASEMENT table, that contains locational information about the easement that the easement is digitized from. "FROM" is the starting point of digitization</attrdef>
    <attrdefs>Data Model Dictionary</attrdefs>
    <attrdomv>
    <udom>IDs of an easement to which FROM side of this easement is connected.</udom>
    </attrdomv>
    <begdatea>20040512</begdatea>
    <enddatea>20040512</enddatea>
    <attrvai>
    <attrva>100</attrva>
    <attrvae>Unknown</attrvae>
    </attrvai>
    <attrmfrq>As needed</attrmfrq>
    </attr>
    <attr>
    <attrlabl>FROM_STREET_ID</attrlabl>
    <attrdef>Foreign key to BAS_STREET_SEGMENT table, that contains locational information about street segment that the easement is digitized from. "FROM" is the starting point of digitization</attrdef>
    <attrdefs>Data Model Dictionary</attrdefs>
    <attrdomv>
    <udom>IDs of an street segment to which FROM side of this easement is connected.</udom>
    </attrdomv>
    <begdatea>20040512</begdatea>
    <enddatea>20040512</enddatea>
    <attrvai>
    <attrva>100</attrva>
    <attrvae>Unknown</attrvae>
    </attrvai>
    <attrmfrq>As needed</attrmfrq>
    </attr>
    <attr>
    <attrlabl>TO_EASEMENT_ID</attrlabl>
    <attrdef>Self-referential key to BAS_EASEMENT table, that contains locational information about the easement that the easement is digitized to. "TO" is the ending point of digitization.</attrdef>
    <attrdefs>Data Model Dictionary</attrdefs>
    <attrdomv>
    <udom>IDs of an easement to which TO side of this easement is closely located.</udom>
    </attrdomv>
    <begdatea>20040512</begdatea>
    <enddatea>20040512</enddatea>
    <attrvai>
    <attrva>100</attrva>
    <attrvae>Unknown</attrvae>
    </attrvai>
    <attrmfrq>As needed</attrmfrq>
    </attr>
    <attr>
    <attrlabl>TO_STREET_ID</attrlabl>
    <attrdef>Foreign key to BAS_STREET_SEGMENT table, that contains locational information about street segment that the easement is digitized to. "TO" is the ending point of digitization.</attrdef>
    <attrdefs>Data Model Dictionary</attrdefs>
    <attrdomv>
    <udom>IDs of an street segment to which TO side of this easement is closely located.</udom>
    </attrdomv>
    <begdatea>20040512</begdatea>
    <enddatea>20040512</enddatea>
    <attrvai>
    <attrva>100</attrva>
    <attrvae>Unknown</attrvae>
    </attrvai>
    <attrmfrq>As needed</attrmfrq>
    </attr>
    <attr>
    <attrlabl>OTH_PROCESSING_STATUS_ID</attrlabl>
    <attrdef>ID of the status/result of last run batch job.</attrdef>
    <attrdefs>Data Model Dictionary</attrdefs>
    <attrdomv>
    <udom>Migrated from PLAN_1 in MGE tables and GIS_TRACKING.MDB Access Database</udom>
    </attrdomv>
    <begdatea>20040512</begdatea>
    <enddatea>20040512</enddatea>
    <attrvai>
    <attrva>100</attrva>
    <attrvae>Unknown</attrvae>
    </attrvai>
    <attrmfrq>As needed</attrmfrq>
    </attr>
    <attr>
    <attrlabl>MUNICIPALITY_NAME</attrlabl>
    <attrdef>Name of municipality in which the easement primarily resides.</attrdef>
    <attrdefs>Data Model Dictionary</attrdefs>
    <attrdomv>
    <codesetd>
    <codesetn>MUNICIPALITY_NAME_DOMAIN</codesetn>
    <codesets>Data Model Dictionary</codesets>
    </codesetd>
    </attrdomv>
    <begdatea>20040512</begdatea>
    <enddatea>20040512</enddatea>
    <attrvai>
    <attrva>100</attrva>
    <attrvae>Updated using Municipal boundary source data.</attrvae>
    </attrvai>
    <attrmfrq>As needed</attrmfrq>
    </attr>
    <attr>
    <attrlabl>RECORD_DRAWING_FLAG</attrlabl>
    <attrdef>Engineering plan that has been accepted by the City of San Jose (Y or N).</attrdef>
    <attrdefs>Data Model Dictionary</attrdefs>
    <attrdomv>
    <udom>USERNAME who last modified this record</udom>
    </attrdomv>
    <begdatea>20040512</begdatea>
    <enddatea>20040512</enddatea>
    <attrvai>
    <attrva>100</attrva>
    <attrvae>Updated using source data.</attrvae>
    </attrvai>
    <attrmfrq>As needed</attrmfrq>
    </attr>
    <attr>
    <attrlabl>ACQUISITION_DATE</attrlabl>
    <attrdef>Official date engineering plan accepted by the City of San Jose on this date</attrdef>
    <attrdefs>Data Model Dictionary</attrdefs>
    <attrdomv>
    <udom>Date/Time stamp of last record modification</udom>
    </attrdomv>
    <begdatea>20040512</begdatea>
    <enddatea>20040512</enddatea>
    <attrvai>
    <attrva>100</attrva>
    <attrvae>Updated using source data.</attrvae>
    </attrvai>
    <attrmfrq>As needed</attrmfrq>
    </attr>
    <attr>
    <attrlabl>GEO_MOD_DATE</attrlabl>
    <attrdef>Time stamp when GEOMETRY column was last modified.</attrdef>
    <attrdefs>Data Model Dictionary</attrdefs>
    <attrdomv>
    <udom>Time stamp when GEOMETRY column was last modified.</udom>
    </attrdomv>
    <begdatea>20040512</begdatea>
    <enddatea>20040512</enddatea>
    <attrvai>
    <attrva>100</attrva>
    <attrvae>Data modified date.</attrvae>
    </attrvai>
    <attrmfrq>As needed</attrmfrq>
    </attr>
    <attr>
    <attrlabl>GDO_GEOMETRY</attrlabl>
    <attrdef>Contains spatial data with true arc geometry.</attrdef>
    <attrdefs>Data Model Dictionary</attrdefs>
    <attrdomv>
    <udom>Oracle Spatial Geometry Data - True Arcs</udom>
    </attrdomv>
    <begdatea>20040512</begdatea>
    <enddatea>20040512</enddatea>
    <attrvai>
    <attrva>100</attrva>
    <attrvae>Unknown</attrvae>
    </attrvai>
    <attrmfrq>As needed</attrmfrq>
    </attr>
    <attr>
    <attrlabl>MAN_OVERRIDE</attrlabl>
    <attrdef>This flag is 'N' by default. If this flag is set to 'Y' no unattended batch process will touch it ever again.</attrdef>
    <attrdefs>Data Model Dictionary</attrdefs>
    <attrdomv>
    <udom>Flag set for batch process</udom>
    </attrdomv>
    <begdatea>20040512</begdatea>
    <enddatea>20040512</enddatea>
    <attrvai>
    <attrva>100</attrva>
    <attrvae>Unknown</attrvae>
    </attrvai>
    <attrmfrq>As needed</attrmfrq>
    </attr>
    <attr>
    <attrlabl>MESSAGE</attrlabl>
    <attrdef>Message from automated batch process to operator; can be "OK", or error message, or "to be checked", etc.</attrdef>
    <attrdefs>data model dictionary</attrdefs>
    <attrdomv>
    <udom>GDO_GEOMETRY.LEN</udom>
    </attrdomv>
    <begdatea>20040512</begdatea>
    <enddatea>20040512</enddatea>
    <attrvai>
    <attrva>100</attrva>
    <attrvae>Unknown</attrvae>
    </attrvai>
    <attrmfrq>As needed</attrmfrq>
    </attr>
    <attr>
    <attrlabl>OTH_PLAN_CREATED</attrlabl>
    <attrdef>PLAN_1 in STREET table should be migrated to BAS_EASEMENT table OTH_PLAN_ID_CREATED column. This value should also be entered into the OTH_PLAN table PLAN_NAME column if not present.</attrdef>
    <attrdefs>Data Dictionary</attrdefs>
    <attrdomv>
    <codesetd>
    <codesetn>OTH_PLAN_DOMAIN</codesetn>
    <codesets>data model dictionary</codesets>
    </codesetd>
    </attrdomv>
    <begdatea>20040512</begdatea>
    <enddatea>20040512</enddatea>
    <attrvai>
    <attrva>100</attrva>
    <attrvae>Unknown</attrvae>
    </attrvai>
    <attrmfrq>As needed</attrmfrq>
    </attr>
    <attr>
    <attrlabl>OTH_PLAN_MODIFIED</attrlabl>
    <attrdef>PLAN_2 in STREET table should be migrated to BAS_EASEMENT table OTH_PLAN_ID_MODIFIED column. This value should also be entered into the OTH_PLAN table PLAN_NAME column if not present</attrdef>
    <attrdefs>Data dictionary</attrdefs>
    <attrdomv>
    <codesetd>
    <codesetn>OTH_PLAN_DOMAIN</codesetn>
    <codesets>data model dictionary</codesets>
    </codesetd>
    </attrdomv>
    <begdatea>20040512</begdatea>
    <enddatea>20040512</enddatea>
    <attrvai>
    <attrva>100</attrva>
    <attrvae>Unknown</attrvae>
    </attrvai>
    <attrmfrq>As needed</attrmfrq>
    </attr>
    <attr>
    <attrlabl>LINEAGE_ID</attrlabl>
    <attrdef>Artificial Numeric Identifier; Assigned to any graphical object; Unique throughout the system. Shared among tables. This column would also be used by EDL Administrator for lineage.</attrdef>
    <attrdefs>Data dictionary</attrdefs>
    <attrdomv>
    <udom>Artificial Numeric Identifier</udom>
    </attrdomv>
    <begdatea>20040512</begdatea>
    <enddatea>20040512</enddatea>
    <attrvai>
    <attrva>100</attrva>
    <attrvae>Unknown</attrvae>
    </attrvai>
    <attrmfrq>As needed</attrmfrq>
    </attr>
    <attr>
    <attrlabl>GDO_GEOMETRY.LEN</attrlabl>
    <attrdef>Created default</attrdef>
    <attrdefs>Data model</attrdefs>
    <attrdomv>
    <udom>unknown</udom>
    </attrdomv>
    <begdatea>20040512</begdatea>
    <enddatea>20040512</enddatea>
    <attrvai>
    <attrva>100</attrva>
    <attrvae>Unknown</attrvae>
    </attrvai>
    <attrmfrq>As needed</attrmfrq>
    </attr>
    </detailed>
    <overview>
    <eaover>Populated using MRF Tools</eaover>
    <eadetcit>Various sources</eadetcit>
    </overview>
    </eainfo>
    <distinfo>
    <distrib>
    <cntinfo>
    <cntperp>
    <cntper>Earl Harris</cntper>
    <cntorg>City of San Jose</cntorg>
    </cntperp>
    <cntpos>Project Manager</cntpos>
    <cntaddr>
    <addrtype>Actual Address</addrtype>
    <address>801 N 1 ST</address>
    <city>San Jose</city>
    <state>CA</state>
    <postal>90000</postal>
    <country>USA</country>
    </cntaddr>
    <cntvoice>408.277.5626</cntvoice>
    <cnttdd>408.277.5626</cnttdd>
    <cntfax>408.298.8382</cntfax>
    <cntemail>[email protected]</cntemail>
    <hours>9-5</hours>
    <cntinst>None</cntinst>
    </cntinfo>
    </distrib>
    <resdesc>Unknown</resdesc>
    <distliab>Unknown</distliab>
    <stdorder>
    <digform>
    <digtinfo>
    <formname>GM Pro Access</formname>
    <formvern>5.1</formvern>
    <formspec>GM Pro 5.1</formspec>
    <formcont>Easement data</formcont>
    <filedec>no compression applied</filedec>
    <transize>60</transize>
    </digtinfo>
    <digtopt>
    <onlinopt>
    <computer>
    <networka>
    <networkr>FTP</networkr>
    </networka>
    </computer>
    <accinstr>FTP</accinstr>
    <oncomp>FTP server</oncomp>
    </onlinopt>
    <offoptn>
    <offmedia>None</offmedia>
    <reccap>
    <recden>1</recden>
    <recdenu>None</recdenu>
    </reccap>
    <recfmt>None</recfmt>
    <compat>None</compat>
    </offoptn>
    </digtopt>
    </digform>
    <fees>Unknown</fees>
    <ordering>Unknown</ordering>
    <turnarnd>Unknown</turnarnd>
    </stdorder>
    <custom>Unknown</custom>
    <techpreq>Unknown</techpreq>
    <availabl>
    <timeinfo>
    <sngdate>
    <caldate>20040512</caldate>
    <time>09000000</time>
    </sngdate>
    </timeinfo>
    </availabl>
    </distinfo>
    <metainfo>
    <metd>20040512</metd>
    <metrd>20040512</metrd>
    <metfrd>20040519</metfrd>
    <metc>
    <cntinfo>
    <cntperp>
    <cntper>Mahesh P Choudhury</cntper>
    <cntorg>Rolta International Inc</cntorg>
    </cntperp>
    <cntpos>Project Manager</cntpos>
    <cntaddr>
    <addrtype>mailing address</addrtype>
    <address>5865 North Point Parkway</address>
    <city>Alpharetta</city>
    <state>GA</state>
    <postal>30022</postal>
    <country>USA</country>
    </cntaddr>
    <cntvoice>678.942.5015</cntvoice>
    <cnttdd>678.942.5015</cnttdd>
    <cntfax>678.942.5001</cntfax>
    <cntemail>[email protected]</cntemail>
    <hours>8-5</hours>
    <cntinst>None</cntinst>
    </cntinfo>
    </metc>
    <metstdn>FGDC Content Standards for Digital Geospatial Metadata</metstdn>
    <metstdv>FGDC-STD-001-1998</metstdv>
    <mettc>local time</mettc>
    <metac>Unknown</metac>
    <metuc>Unknown</metuc>
    <metsi>
    <metscs>Unknown</metscs>
    <metsc>Confidential</metsc>
    <metshd>Unknown</metshd>
    </metsi>
    <metextns>
    <onlink>http://www.esri.com/metadata/esriprof80.html</onlink>
    <metprof>ESRI Metadata Profile</metprof>
    </metextns>
    </metainfo>
    </metadata>

    I am having error while registering as undefined element for citeinfo, timeinfo and cntinfo as shown below
    Please could you help me solve.
    thanks
    </xs:appinfo>
              </xs:annotation>
    </xs:element>     
    <xs:complexType name="citationType">          
    <xs:sequence>               
    *<xs:element ref="citeinfo"/>*          
    </xs:sequence>     
    </xs:complexType>
    SQL> BEGIN
    2 DBMS_XMLSCHEMA.registerSchema(
    3 SCHEMAURL => 'fgdc-std-001-1998-sect011.xsd',
    4 SCHEMADOC => bfilename('XMLDIR','fgdc-std-001-1998-sect011.xsd'),
    5 CSID => nls_charset_id('UTF8'));
    6 END;
    7 /
    BEGIN
    ERROR at line 1:
    ORA-31154: invalid XML document
    ORA-19202: Error occurred in XML processing
    LSX-00021: undefined element "citeinfo"
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 37
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 61
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 126
    ORA-06512: at line 2
    </xs:appinfo>          
    </xs:annotation>     
    </xs:element>     
    <xs:complexType name="timeperdType">          
    <xs:sequence>               
    *<xs:element ref="timeinfo"/>     *          
    <xs:element ref="current"/>          
    </xs:sequence>     
    </xs:complexType>     
    <xs:element name="current" type="currentType">
    </xs:appinfo>          
    </xs:annotation>     
    </xs:element>     
    <xs:complexType name="ptcontacType">          
    <xs:sequence>               
    *<xs:element ref="cntinfo"/>     *
    </xs:sequence>
         </xs:complexType>     
    <xs:element name="browse" type="browseType">          
    <xs:annotation>

  • XML: How to convert xml string into Node/Document

    I have a string in xml form.
    <name>
    <first/>
    <second/>
    </name>
    I want to convert this string into DOM Node or Document.
    How can I do this?
    Any help or pointer?
    TIA
    Sachin

    Try this :
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    Document doc = db.parse(new org.xml.sax.InputSource(new StringReader(strXml)));Hope this helps.

  • Convert XML string into XML

    Hi All,
    Can you please let me know for any sample code in xslt/java mapping for converting XML string into XML. We use SAP Pi 7.0
    My XML string starts like this
    <?xml version="1.0" encoding="UTF-8" ?> 
    - <ns0:MT_ReceiverFileStructure <namespace>"><Output><?xml version="1.0" encoding="ISO-8859-9"?><?xml-stylesheet type="text/xsl" href="<xsl>"?><Tarih_Date Tarih="11.09.2014" Date="09/11/2014>
       Thanks,
       Pavithra

    Thanks Praveen. It worked.
    However, the xml i have is an extract from a exchange rate URL and it has the reference to a xsl in it as below
    <?xml version="1.0" encoding="ISO-8859-9"?><?xml-stylesheet type="text/xsl" href="<ABC.xsl>"?>.
    So there is an error in sxmb_moni. Is it possible to remove this.

  • Convert XML string into an abap format date and time

    Hi,
    Does anyone know of a method or a function module in ABAP which converts XML string into an abap format date and time.
    Here is a part of the xml that I want to convert.
    <ns2:EventDateTime>2009-07-02T10:13:45+10:00</ns2:EventDateTime>
    <ns2:EventMessageTransmissionDateTime>2009-07-02T10:13:45.987+10:00</ns2:EventMessageTransmissionDateTime>
    Currently EventDateTime and EventMessageTransmissionDateTime are type XSDDATETIME_Z and these are converted to proper dates and times. We will be changing these fields to a STRING instead of XSDDATETIME_Z. The reason for this is to make the field more versatile. The customer would be receiving dates with Zulu (2009-09-23T12:00:00Z), with offsets (2009-09-23T12:00:00+10:00/-10:00) and just local timestamp (2009-09-23T12:00:00). With this, we need to make the date fields as string
    to be able to accept the various date formats (esp. the local timestamp).
    I am looking for a standard function module or method that will convert the xml string to a proper date and time abap format.
    Would appreciate anyone's help!
    Thanks.
    Edited by: eunice ocson on Jul 13, 2009 1:49 AM
    Edited by: eunice ocson on Jul 13, 2009 1:50 AM
    Edited by: eunice ocson on Jul 13, 2009 1:51 AM
    Edited by: eunice ocson on Jul 13, 2009 1:51 AM

    Hi Eunice
    Use the FM 'SMUM_XML_PARSE'
    for more info
    [Convert XML string to ABAP|XML String to ABAP or GUI]
    hope it helps you.
    Thanks!!

  • Getting null value while parsing "XML String" with  encoding WINDOWS-1252.

    Hi,
    when I am converting the Follwoing "xml string " to Document, I am getting the "null" as a document value.
        String strXML =  "<?xml version="1.0" encoding="WINDOWS-1252"?>
                              <category name="SearchByAttributes" value="Search By Attributes">
                                <item name="ORDER_LINE_ID" description="Application Search Attributes" >
                                   <attribute name="Sequence" value="0001"/>
                                 </item>
                                </category>"      
    My "xml string" has the encoding vaule: WINDOWS-1252.
    I am using the following code to convert the "xml string" to Document. I am getting the Document values as a "null" while converting the above "string xml"
            String strXML = //my above string xml.
            DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
            docBuilderFactory.setIgnoringElementContentWhitespace(true);
            docBuilder = docBuilderFactory.newDocumentBuilder();
            doc = docBuilder.parse(new InputSource(new StringReader(strXML)));              
            System.out.println("doc value.."+doc)//I am getting null value for "doc".
    Can anyone help me to resolve the issue.

    Thagelapally wrote:
    I am coverting the below "XML string" to Document, once it is converted I am reading that Document,which have an "attribue" Element in.
      String strXML = "<?xml version="1.0" encoding="WINDOWS-1252"?>
    <category name="SearchByAttributes" value="Search By Attributes">
    <item name="ORDER_LINE_ID" description="Application Search Attributes" >
    <attribute name="Sequence" value="0001"/>
    </item>
    </category>" I am using the above code to read the Document. When run the code in "OC4J Server" and using Jdeveloper as an editor,I am able to perfectly read the "attribute" element in the document with out any problem.Println statement printing as I expected.
    System.out.println("Element Name..."+listOfAtt.getNodeName());
    //getting Element Name as...."attribute"(as expected)
    System.out.println("Element Attibrute list....."+elementAtt);
    //getting Element Attribute list as an...."oracle.xml.parser.v2.XMLAttrList@afe"But when run the same code(reading the same Document) in Tomcat and Eclipse,println satatement not printing as i expected.
    System.out.println("Element Name..."+listOfAtt.getNodeName());
    //getting Element Name as...."#text"(I am expecting output value "attribute" but it is printing "#text" which i don't know)
    System.out.println("Element Attibrute list....."+elementAtt);
    //getting Element Attribute list as an...."null"(I am expecting output value object reference but it is printing "null"
    (without the rest of the code, i'm guessing that) most likely you are grabbing the first child node of the item element. however, you are not accounting for some text nodes that are most likely in that list, like the whitespace between the item element and the attribute element. please go read some tutorials on xml, there are thousands of them out there, and they will answer all you initial questions much more efficiently than posting each step to the forums.

  • Converting XML string to internal table

    Hello everyone,
    I am trying to convert an XML string to an internal table. The format of the XML string is as follows:
    <node label="Compressors" NODE_ID="783" checked="1" expandStatus="false">
       <node label="Nail guns" NODE_ID="78543" checked="1" expandStatus="false"/>
       <node label="Spray guns" NODE_ID="855" checked="0" expandStatus="false"/>
       <node label="Cleaning equipment" NODE_ID="9" checked="1" expandStatus="false"/>
    </node>
    What I need is an internal table with the fields NODE_ID and checked filled. The hierarchy here doesn't matter, so I just need an internal table of a structure with 2 fields. The whole XML is hierarchical and contains only the <node> tag, which can be self-closing or not with the attributes within the tag.
    What is the best way to accomplish this?
    Performance here is quite important too, as this XML can contain over 100,000 nodes.
    Should it be done with an xpath expression, with a regex, with the iXML parser, an XSLT call transformation?
    Any help is greatly appreciated!
    Best regards,
    Vincent

    Use this FM to get into internal table
                CALL FUNCTION 'ECATT_CONV_XSTRING_TO_STRING'
                  EXPORTING
                    im_xstring = zl_attcntx
                  IMPORTING
                    ex_string  = zl_attcont.
       SPLIT zl_attcont AT cl_abap_char_utilities=>newline INTO TABLE zit_legacy.

  • Converting XML string to ABAP types

    Hello,
    I am having a requirement where i wanted to parse incoming XML string and i checked few of examples of CALL TRANSFORMATION id.
    but whatever examples i checked those were simple transformation with no hierarchy.
    My source structure
    <record>
    <firstname>XYZ</firstname>
    <position>Testposition</postion>
    </record>
    and i used
    CALL transformation id
    source xml lv_xml
    result firstname = lv_firstname position = lv_position.
    but lv_firstname and lv_position were blank. any idea whether it can be acheived through such method?
    thanks in advance.
    regards
    rajeev

    Hello Rajeev,
    Try using the following simple transformation
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
      <tt:root name="record"/>
      <tt:template name="record">
        <record>
          <firstname>
            <tt:value ref="record.firstname"/>
          </firstname>
          <position>
            <tt:value ref="record.position"/>
          </position>
        </record>
      </tt:template>
    </tt:transform>
    In your code you could define a structure like the following:
    TYPES: BEGIN OF record,
                  firstname TYPE char50,
                  position  TYPE char50,
                END OF record.
    And now you could use the CALL TRANSFORMATION in your code to convert the xml string into the structure and visa-versa.
    CALL TRANSFORMATION zcl_test_rec
          SOURCE XML lv_string
          RESULT record = ls_test.
    Where lv_string holds the xml as a string and ls_test is defined as a structure of type record (defined above).
    Hope this helps.
    Thank you,
    Ramneek

  • Converting XML String to MessageElement array

    Hi,
    I am trying to call a .NET web service from my Java client. I used WSDL2Java to generate the java classes for calling the .NET web service. The generated classes to call the service expects an array of org.apache.axis.message.MessageElement objects. I have a string representing an XML document which looks like this:
    String xmlString = "<Results><Adjustments><Adjustment><RebuildAdjustmentID>16</RebuildAdjustmentID><IsBasicAdjustment>true</IsBasicAdjustment><AdjustmentType>stone/AdjustmentType><Title>External walls</Title></Adjustment></Adjustments></Results>"
    I have tried converting the string into an array of MessageElement objects by the following way:
    MessageElement[] m = new MessageElement[1];
    Document XMLDoc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(result2.toString())));
    m[0] = XMLDoc.getDocumentElement();
    However I keep getting the following message returned from the service:
    "Object reference not set to an instance of an object"
    I have tried a handful of ways but keep getting this same error. I have searched the web for hours looking for a solution to this problem without success so any help/ideas much appreciated,
    Thanks.
    Paul

    Any updates on this?
    I am facing a similar problem.

  • Convert xml string into xml file?

    Hi,
    I got a method that returns an JDom Element object.
    Then I use the JDOM Element toString method() to change it into xml string.
    Now, I need to convert it into actual xml file.
    How to I do it?
    Thanks.

    Hi,
    If you got an xml string, just write it to an ordinary file. Look at FileWriter.
    /Kaj

  • To convert  XML String- ResultSet

    Hi
    I am using Web Services created in EJB and will be accessed from JSP client containing applet-swing based GUI, using n tier architecture so I need to convert the XML String to Java ResultSet. (I am able to convert the ResultSet -> XML string using ResultSetBuilder), So I just want to know how to convet the XML String to Java ResultSet.
    Secondly is there any method to manually add columns to the ResultSet.
    Will anybody tell me of any utility, tools or the methods so that I can accomplish this task.
    Thank in advance
    nitin

    What would be the point of doing this? A ResultSet is basically like a cursor running against a database query. You could create a fake ResultSet and pass it something else but why? Just use a normal data-structure.

  • How to convert xml String to xml file?

    Hi,
    I got a method that do the following:
    public static String convertXmlToString(String xmlFileName) throws Exception
            File file = new File(xmlFileName);
            FileInputStream insr = new FileInputStream(file);
            byte[] fileBuffer = new byte[(int)file.length()];
            insr.read(fileBuffer);
            insr.close();
            return new String(fileBuffer);
         }The return String is the contents of an existing xml file and one example is shown below:
    <object type="server.WOXReference" id="0"><field name="actualPathObj"><object type="java.lang.String" id="1">C:\restClient\actualXMLObjects\812856084.xml</object></field><field name="object"><object type="server.WOXConstructor" id="2"><field name="className"><object type="java.lang.String" id="3">rec.SimpleRecognizer</object></field><field name="types"><array type="java.lang.String" length="3" id="4"><object type="java.lang.String" id="5">double[].class</object><object type="java.lang.String" id="6">double.class</object><object idref="6" /></array></field><field name="args"><array type="java.lang.Object" length="3" id="7"><array type="double" length="5" id="8">22.33 33.22 33.33 22.0 11.0</array><object type="java.lang.Double" id="9">2.2</object><object type="java.lang.Double" id="10">3.3</object></array></field><field name="retType"><object type="java.lang.String" id="11">act</object></field></object></field></object>
    and I want to change the above string to xml file like below:
    <object type="server.WOXReference" id="0"><field name="actualPathObj"><object type="java.lang.String" id="1">C:\restClient\actualXMLObjects\812856084.xml</object></field><field name="object"><object type="server.WOXConstructor" id="2"><field name="className"><object type="java.lang.String" id="3">rec.SimpleRecognizer</object></field><field name="types"><array type="java.lang.String" length="3" id="4"><object type="java.lang.String" id="5">double[].class</object><object type="java.lang.String" id="6">double.class</object><object idref="6" /></array></field><field name="args"><array type="java.lang.Object" length="3" id="7"><array type="double" length="5" id="8">22.33 33.22 33.33 22.0 11.0</array><object type="java.lang.Double" id="9">2.2</object><object type="java.lang.Double" id="10">3.3</object></array></field><field name="retType"><object type="java.lang.String" id="11">act</object></field></object></field></object>How to I change the above xml String back to xml file again? The appropriate tags must be taken care of like > must be > and < must be <.
    Please advice and can give me some sample code.
    Thanks.

    By writing some code that runs through the file and adds a new line for a new element using these methods here...
    http://java.sun.com/j2se/1.4.2/docs/api/org/xml/sax/ContentHandler.html
    i.e.
    startDocument()
    startElement(String namespaceURI, String localName, String qName, Attributes atts)
    endDocument()

  • Converting XML string to Element Type

    Im receiving an XML document as a String.
    I have defined an element whose message type is of the same schema as the XML String.
    How can i assign this string to this element in BPEL?
    im using the setVariable function as follows:
    setVariableData("Customer","CustomerType", new String(received))
    It does not throw an error. But im unable to retrieve any of the values from this element.
    Could someone pls help me with this?

    The output seems to be fine and structured in the XML Format, when i pass the string to the Message Type(ie CustomerType) rather than the root node (CustomerElement).
    eg: in this case i have
    Customer - > CustomerType -> CustomerElement - > Name, date etc...
    When i assign the string to Customer Element, it displays it as a string.
    When i assign the string to CustomerType it displays it in the XML Structure.
    It however throws an error when i assign an element in the data to something.

  • Convert XML-String from Codepage utf-16 to ISO-8859-1

    Hi to all experts,
    our system is now unicode with codepage 4102 (UTF-16) and we do an Simple Transformation for creating an XML-String.
    before UniCode : xml_data = <?xml version="1.0" encoding="iso-8859-1"?>#<transactionRequest userID=" .......
    now with UniCode : xml_data = <?xml version="1.0" encoding="utf-16"?>#<transactionRequest userID=".......
    The xml_data transfered to an external Sytem via HTTPS- Communication direct from ABAP.
    The external Sytem send an Error Request:
    <?xml version="1.0" encoding="ISO-8859-1"?>#<transactionResponse>#    <transactionErrorResponse>#        <errorResponse>#            <errorCode>SYS-0001</errorCode>#            <errorDescription>java.lang.Exception: null[ #<?xml version="1.................
    Have you any idea
    Thanks for your help!
    Peter
    Edited by: Peter Pforr on Sep 25, 2008 9:59 AM
    Edited by: Peter Pforr on Sep 25, 2008 10:14 AM

    Darshan,
    Did you get an answer for this question? We have same requirement to create XML file in ISO-8859-1 format with Attributes is set to "Y" and CDATA is being used for data.
    Can you please let me know if you still remember how did you achieve it?
    Satyen...

Maybe you are looking for

  • Free Goods not flowing when creating return order through invocie reference

    Hi , we have configured free goods scenario for our client. Free goods are determined in sales order based on condition maintained In sales order Tan ,and Tann item category are determined and based on SO , delivery and billing type (F2 ) happens. No

  • HDMI detective vs. MDP-HDMI adapter

    I would like to get a new Mac Mini for use as a media server with my TV.  The TV wants HDMI input, but I understand Mac Minis can have problems with the HDMI sleep signal the TV may send when turned off. I know one solution to this is to use a Gefen

  • Sequence settings for 16:9

    Hi, Just doing some PAL tests of 16:9 HD to 16:9 SD downconvert. What are the sequence settings for this? If I use the normal DV PAL 48khz, the VIEWER window shows a normal 16:0 ratio, but the CANVAS window shows a letterboxed 4:3 window. When I expo

  • HELP- Itunes update has deleted music

    I've just updated to Itunes version 7.3.1.3 and my music has gone from 4500 songs to 1800 songs. Any help would be greatly appreciated as I can't find them anywhere. Thanks

  • Show Parenth description on Excel input report

    Hi experts, i build a drag and drop input report to show 2 dimension (Entity and Account) x 1 dimension (time). Well i need to show before to the columns of identity (i show description of the basmembers) parenth assigned to each member of entity. it