on 12-14-2016 6:58 AM
I have a xsd which i have created on my own. I want to find the xpath for the XSD for the element "super" Kindly help me how should i do that.
<?xml version="1.0" encoding="ISO-8859-1" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:complexType name="shiptoType"> <xs:sequence> <xs:element name="super" type="xs:string" /> <xs:element name="address" type="xs:string" /> <xs:element name="city" type="xs:string" /> <xs:element name="country1" type="xs:string" /> <xs:element name="country2" type="xs:string" /> <xs:element name="country3" type="xs:string" /> <xs:element name="country4" type="xs:string" /> <xs:element name="country5" type="xs:string" /> <xs:element name="country6" type="xs:string" /> <xs:element name="country7" type="xs:string" /> <xs:element name="country8" type="xs:string" /> <xs:element name="country9" type="xs:string" /> <xs:element name="country10" type="xs:string" /> <xs:element name="country11" type="xs:string" /> <xs:element name="country12" type="xs:string" /> <xs:element name="country13" type="xs:string" /> <xs:element name="country14" type="xs:string" /> <xs:element name="country15" type="xs:string" /> <xs:element name="country16" type="xs:string" /> <xs:element name="country17" type="xs:string" /> <xs:element name="country18" type="xs:string" /> <xs:element name="country19" type="xs:string" /> <xs:element name="country20" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:schema>
Thanks and Regards,
Vijay.
Hello Vijay,
I guess your XSD needs to be changed.
1 ) Add one more element after node <SFSF_EC> ...Ex <records> [ Which will be repeated for each data record ].
2) Import the XSD and give below XPATH it works.
SFSF_EC/Records
As per the XML standard you must have one root node so i guess you need to change the structure to above one.
Regards,
Sriprasad Shivaram Bhat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Vijay,
Could you please share your complete XML and also please let me know which step you want to use the same.
Regards,
Sriprasad Shivaram Bhat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sriprasad,
Actually , my requirement is i have a PIPE delimted txt file and i want to convert to xml . so to use the CSV TO XML Converter , i need the XSD so i am creating the XSD and .
Input txt file is :-
PA40|Letter Type|Empl Id|Name|From Date|Date Of Offence|Begin Date of Investigation|Type of Disc. Action|Date Of Ack of Charge|Sequence|Dis Level|Review Period|Investigation Held|Issuing Authority|Epts File#|Inv Time|Rule 1|Rule 2|Rule 3|Rule 4|Rule 5|Rule 6|Remarks From Acu Trans|
So i have to create the XSD for this to use the CSV to xml converter.
and this is my xsd
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="SFSF_EC"> <xs:complexType> <xs:sequence> <xs:element name="PA40"></xs:element> <xs:element name="Letter_Type"></xs:element> <xs:element name="Emp_ID"></xs:element> <xs:element name="Name"></xs:element> <xs:element name="From_Date"></xs:element> <xs:element name="Date_of_Offence"></xs:element> <xs:element name="Begin_Date_of_Investigation"></xs:element> <xs:element name="Type_of_Disc_Action"></xs:element> <xs:element name="Date_Of_Ack_of_Charge"></xs:element> <xs:element name="Sequence"></xs:element> <xs:element name="Discipline_Level"></xs:element> <xs:element name="Review_Period"></xs:element> <xs:element name="Issuing_Authority"></xs:element> <xs:element name="Investigation_Held"></xs:element> <xs:element name="EPTS_File"></xs:element> <xs:element name="Inv_Time"></xs:element> <xs:element name="Rule1"></xs:element> <xs:element name="Rule2"></xs:element> <xs:element name="Rule3"></xs:element> <xs:element name="Rule4"></xs:element> <xs:element name="Rule5"></xs:element> <xs:element name="Rule6"></xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
and i have given the path as "//xs:PA40" but the error is like
java.lang.IllegalStateException: Element name [] not found in provided XML schema file
Kindly help me with this.
Regards,
Vijay
epts.txt<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="SFSF_EC"> <xs:complexType> <xs:sequence> <xs:element name="PA40"></xs:element> <xs:element name="Letter_Type"></xs:element> <xs:element name="Emp_ID"></xs:element> <xs:element name="Name"></xs:element> <xs:element name="From_Date"></xs:element> <xs:element name="Date_of_Offence"></xs:element> <xs:element name="Begin_Date_of_Investigation"></xs:element> <xs:element name="Type_of_Disc_Action"></xs:element> <xs:element name="Date_Of_Ack_of_Charge"></xs:element> <xs:element name="Sequence"></xs:element> <xs:element name="Discipline_Level"></xs:element> <xs:element name="Review_Period"></xs:element> <xs:element name="Issuing_Authority"></xs:element> <xs:element name="Investigation_Held"></xs:element> <xs:element name="EPTS_File"></xs:element> <xs:element name="Inv_Time"></xs:element> <xs:element name="Rule1"></xs:element> <xs:element name="Rule2"></xs:element> <xs:element name="Rule3"></xs:element> <xs:element name="Rule4"></xs:element> <xs:element name="Rule5"></xs:element> <xs:element name="Rule6"></xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.