dynamically created & manual html


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: dynamically created & manual html

  1. #1
    Join Date
    Jul 2008
    Posts
    32

    dynamically created & manual html

    i am creating a xml dcoument from code in vb6.0 & validating it against xsd using msxml4.0
    everything working fine
    the xml file is formed from the code / the data i get during runitme
    when i validate it it gives me the validation results but it seems that the entire xml doument is in one line though the xml document tags appears in diferent lines
    as when i validate it for multiple error it gives me everytime line 1 but change in column no

    i made the same file wth same data manually & validated it
    in that i get the proper line no & column no
    suppose the error is in line 10 i get line no 10 column no 5

    but the file that is generated dynamically gives me error but taking the whole document as line 1
    how do i redcity it so that i get the proper line no

  2. #2
    Join Date
    May 2009
    Posts
    60
    without the xml code is the error difficult to define or recognize

    show xml and /or schema if any so we can help you
    Otherwise it is the only advise

  3. #3
    Join Date
    Jul 2008
    Posts
    32
    yes it tooo difficult to trcae the error with out knowing the exact location of the error as we need to check for each & every element & the xml can be of more than 1000 lines

    this is the xml(part of the actual file as that file is too long)
    <XML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="XML_DLR.xsd">
    - <RETURN ReturnType="DLR" ToolVer="1.0">
    - <HEADER-DATA>
    <RETURN-YEAR>2010</RETURN-YEAR>
    <QUARTER>JUL-SEP</QUARTER>
    <DEALER>XYZ ENT</DEALER>
    <RNUMBER>AAAAP6590JXD001</RNUMBER>
    <NIL-RETURN>No</NIL-RETURN>
    </HEADER-DATA>
    - <INVOICE-HEADER>
    - <INVOICE-PARTICULARS SL-NO="1">
    <INUMBER>132</INUMBER>
    <IDATE>01/07/2010</IDATE>
    - <INVOICE-ITEMS>
    <DESCRIPTION>prdy name</DESCRIPTIONS>
    <NUMBER>12345678</NUMBER>
    <-CODE>KG</CODE>
    <QUANTITY>24000</QUANTITY>
    <AMOUNT>10000</AMOUNT>
    </INVOICE-ITEMS>
    </INVOICE-PARTICULARS>
    </INVOICE-HEADER>
    <SELF>
    <DATE>19/03/2011</DATE>
    <PLACE>-</PLACE>
    <REMARKS>-</REMARKS>
    </SELF->
    </RETURN>
    </XML>

    if there is a validation msg that amount is inorrect as per the schema patten
    there will be many lines have the amount its difficult to trace so if any way the code can be converted to physical lines as it visible in browser it can be helpful
    if th open this xml in notepad ediotr all the tags & data appear in one line

  4. #4
    Join Date
    May 2009
    Posts
    60
    First, it is not allowed in xml tag name to use with xml

    and then your xml is not valid
    the fault lies with tag DESCRIPTION
    The closing tag is with you DESCRIPTIONS
    your xml

    Code:
    <?xml version="1.0"?>
    <XML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="XML_DLR.xsd">
    	<RETURN ReturnType="DLR" ToolVer="1.0">
     	<HEADERDATA>
    		<RETURNYEAR>2010</RETURNYEAR>
    		<QUARTER>JULSEP</QUARTER>
    		<DEALER>XYZ ENT</DEALER>
    		<RNUMBER>AAAAP6590JXD001</RNUMBER>
    		<NILRETURN>No</NILRETURN>
    	</HEADERDATA>
     	<INVOICEHEADER>
     		<INVOICEPARTICULARS SLNO="1">
    			<INUMBER>132</INUMBER>
    			<IDATE>01/07/2010</IDATE>
    			<INVOICEITEMS>
    				<DESCRIPTION>prdy name</DESCRIPTIONS>
    				<NUMBER>12345678</NUMBER>
    				<CODE>KG</CODE>
    				<QUANTITY>24000</QUANTITY>
    				<AMOUNT>10000</AMOUNT>
    			</INVOICEITEMS>
    		</INVOICEPARTICULARS>
    	</INVOICEHEADER>
    	<SELF>
    		<DATE>19/03/2011</DATE>
    		<PLACE></PLACE>
    		<REMARKS></REMARKS>
    	</SELF>
    </RETURN>
    </XML>
    right xml
    Code:
    <?xml version="1.0"?>
    <DATAXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="XML_DLR.xsd">
    	<RETURN ReturnType="DLR" ToolVer="1.0">
    		<HEADERDATA>
    			<RETURNYEAR>2010</RETURNYEAR>
    			<QUARTER>JULSEP</QUARTER>
    			<DEALER>XYZ ENT</DEALER>
    			<RNUMBER>AAAAP6590JXD001</RNUMBER>
    			<NILRETURN>No</NILRETURN>
    		</HEADERDATA>
    		<INVOICEHEADER>
    			<INVOICEPARTICULARS SLNO="1">
    				<INUMBER>132</INUMBER>
    				<IDATE>01/07/2010</IDATE>
    				<INVOICEITEMS>
    					<DESCRIPTION>prdy name</DESCRIPTION>
    					<NUMBER>12345678</NUMBER>
    					<CODE>KG</CODE>
    					<QUANTITY>24000</QUANTITY>
    					<AMOUNT>10000</AMOUNT>
    				</INVOICEITEMS>
    			</INVOICEPARTICULARS>
    		</INVOICEHEADER>
    		<SELF>
    			<DATE>19/03/2011</DATE>
    			<PLACE></PLACE>
    			<REMARKS></REMARKS>
    		</SELF>
    	</RETURN>
    </DATAXML>
    xsd
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    	<xs:attribute name="ToolVer">
    		<xs:simpleType>
    			<xs:restriction base="xs:decimal">
    				<xs:enumeration value="1.0"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:attribute>
    	<xs:attribute name="SLNO">
    		<xs:simpleType>
    			<xs:restriction base="xs:byte">
    				<xs:enumeration value="1"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:attribute>
    	<xs:attribute name="ReturnType">
    		<xs:simpleType>
    			<xs:restriction base="xs:string">
    				<xs:enumeration value="DLR"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:attribute>
    	<xs:element name="SELF">
    		<xs:complexType>
    			<xs:sequence>
    				<xs:element ref="DATE"/>
    				<xs:element ref="PLACE"/>
    				<xs:element ref="REMARKS"/>
    			</xs:sequence>
    		</xs:complexType>
    	</xs:element>
    	<xs:element name="RNUMBER">
    		<xs:simpleType>
    			<xs:restriction base="xs:string">
    				<xs:enumeration value="AAAAP6590JXD001"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:element>
    	<xs:element name="RETURNYEAR">
    		<xs:simpleType>
    			<xs:restriction base="xs:short">
    				<xs:enumeration value="2010"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:element>
    	<xs:element name="RETURN">
    		<xs:complexType>
    			<xs:sequence>
    				<xs:element ref="HEADERDATA"/>
    				<xs:element ref="INVOICEHEADER"/>
    				<xs:element ref="SELF"/>
    			</xs:sequence>
    			<xs:attribute ref="ToolVer" use="required"/>
    			<xs:attribute ref="ReturnType" use="required"/>
    		</xs:complexType>
    	</xs:element>
    	<xs:element name="REMARKS">
    		<xs:complexType/>
    	</xs:element>
    	<xs:element name="QUARTER">
    		<xs:simpleType>
    			<xs:restriction base="xs:string">
    				<xs:enumeration value="JULSEP"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:element>
    	<xs:element name="QUANTITY">
    		<xs:simpleType>
    			<xs:restriction base="xs:short">
    				<xs:enumeration value="24000"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:element>
    	<xs:element name="PLACE">
    		<xs:complexType/>
    	</xs:element>
    	<xs:element name="NUMBER">
    		<xs:simpleType>
    			<xs:restriction base="xs:int">
    				<xs:enumeration value="12345678"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:element>
    	<xs:element name="NILRETURN">
    		<xs:simpleType>
    			<xs:restriction base="xs:string">
    				<xs:enumeration value="No"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:element>
    	<xs:element name="INVOICEPARTICULARS">
    		<xs:complexType>
    			<xs:sequence>
    				<xs:element ref="INUMBER"/>
    				<xs:element ref="IDATE"/>
    				<xs:element ref="INVOICEITEMS"/>
    			</xs:sequence>
    			<xs:attribute ref="SLNO" use="required"/>
    		</xs:complexType>
    	</xs:element>
    	<xs:element name="INVOICEITEMS">
    		<xs:complexType>
    			<xs:sequence>
    				<xs:element ref="DESCRIPTION"/>
    				<xs:element ref="NUMBER"/>
    				<xs:element ref="CODE"/>
    				<xs:element ref="QUANTITY"/>
    				<xs:element ref="AMOUNT"/>
    			</xs:sequence>
    		</xs:complexType>
    	</xs:element>
    	<xs:element name="INVOICEHEADER">
    		<xs:complexType>
    			<xs:sequence>
    				<xs:element ref="INVOICEPARTICULARS"/>
    			</xs:sequence>
    		</xs:complexType>
    	</xs:element>
    	<xs:element name="INUMBER">
    		<xs:simpleType>
    			<xs:restriction base="xs:short">
    				<xs:enumeration value="132"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:element>
    	<xs:element name="IDATE">
    		<xs:simpleType>
    			<xs:restriction base="xs:string">
    				<xs:enumeration value="01/07/2010"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:element>
    	<xs:element name="HEADERDATA">
    		<xs:complexType>
    			<xs:sequence>
    				<xs:element ref="RETURNYEAR"/>
    				<xs:element ref="QUARTER"/>
    				<xs:element ref="DEALER"/>
    				<xs:element ref="RNUMBER"/>
    				<xs:element ref="NILRETURN"/>
    			</xs:sequence>
    		</xs:complexType>
    	</xs:element>
    	<xs:element name="DESCRIPTION">
    		<xs:simpleType>
    			<xs:restriction base="xs:string">
    				<xs:enumeration value="prdy name"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:element>
    	<xs:element name="DEALER">
    		<xs:simpleType>
    			<xs:restriction base="xs:string">
    				<xs:enumeration value="XYZ ENT"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:element>
    	<xs:element name="DATE">
    		<xs:simpleType>
    			<xs:restriction base="xs:string">
    				<xs:enumeration value="19/03/2011"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:element>
    	<xs:element name="DATAXML">
    		<xs:complexType>
    			<xs:sequence>
    				<xs:element ref="RETURN"/>
    			</xs:sequence>
    		</xs:complexType>
    	</xs:element>
    	<xs:element name="CODE">
    		<xs:simpleType>
    			<xs:restriction base="xs:string">
    				<xs:enumeration value="KG"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:element>
    	<xs:element name="AMOUNT">
    		<xs:simpleType>
    			<xs:restriction base="xs:short">
    				<xs:enumeration value="10000"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:element>
    </xs:schema>

  5. #5
    Join Date
    Jul 2008
    Posts
    32
    it was my typing error
    everything is fine only i have problem reg finding the location of the validating error
    i just put on the first line as <xml for the forum purpose
    Last edited by svibuk; 04-05-2011 at 08:29 AM.

Similar Threads

  1. Replies: 1
    Last Post: 06-07-2006, 03:39 AM
  2. Replies: 4
    Last Post: 08-01-2003, 01:06 PM
  3. Replies: 0
    Last Post: 05-13-2002, 06:00 PM
  4. Replies: 1
    Last Post: 05-07-2002, 10:32 AM
  5. Replies: 0
    Last Post: 05-16-2001, 05:24 PM

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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center