XSD validation error: Cannot find the declaration of element 'xs:schema' - java

I saw that this question was asked many times but I didn't find a solution to my problem. So the error is:
Error on line 2 of document file...doc.xsd: cvc-elt.1: Cannot find the declaration of element 'xs:schema'
The code in the XSD file:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Collection" >
<xs:complexType>
<xs:sequence>
<xs:element name="Description" type="xs:string"/>
<xs:element name="Recipe" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Title" type="xs:string"/>
<xs:element name="Ingredients">
<xs:complexType>
<xs:element name="Ingredient" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="amount" type="xs:integer" use="required"/>
<xs:attribute name="unit" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:complexType>
</xs:element>
<xs:element name="Preparation">
<xs:complexType>
<xs:element name="Step" type="xs:string minOccurs="0" maxOccurs="unbounded"/>"
</xs:complexType>
</xs:element>
<xs:element name="Comment" type="xs:string" minOccurs="0"/>
<xs:element name="Nutrients">
<xs:complexType>
<xs:attribute name="proteins" type="xs:integer" use="required"/>
<xs:attribute name="carbohidrati" type="xs:NMTOKEN" use="required"/>
<xs:attribute name="fat" type="xs:integer" use="choice"/>
<xs:attribute name="vitamins" type="xs:NMTOKEN" use="required"/>
<xs:attribute name="calories" type="xs:float" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
The code in the XML file:
<?xml version="1.0" encoding="UTF-8"?>
<Collection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="src/doc.xsd">
<Description>Nu prea merge</Description>
<Recipe>
<Title>Paste</Title>
<Ingredients>
<Ingredient name="paste" amount="1" unit="pachet"></Ingredient>
</Ingredients>
<Preparation>
<Step>Fierbere</Step>
<Step>Servire</Step>
</Preparation>
<Nutrients proteins="2" carbohidrati="2" fat="da" vitamins="4" calories="1000.9"></Nutrients>
</Recipe>
</Collection>
The code in my Java class:
import java.io.File;
import java.io.IOException;
import org.jdom2.Document;
import org.jdom2.JDOMException;
import org.jdom2.input.SAXBuilder;
import org.jdom2.input.sax.XMLReaders;
import org.jdom2.output.Format;
import org.jdom2.output.XMLOutputter;
public class Main {
public static void main(String[] args) {
File newFile = new File("src/doc.xsd");
Document doc = null;
SAXBuilder sbd = new SAXBuilder(XMLReaders.XSDVALIDATING);
try {
doc = sbd.build(newFile);
} catch (JDOMException | IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
XMLOutputter outputDoc = new XMLOutputter();
outputDoc.setFormat(Format.getPrettyFormat());
try{
outputDoc.output(doc,System.out);
//outputDoc.output(doc, new FileWriter("src/myXmlDoc2.xml"));
}
catch(Exception e){
System.out.println("Eroare la parsarea documentului XML!");
}
}
}
If anyone has any idea about the possible problem please help me!

Assuming that your XML is fixed, then you should change your XSD as follows:
Fix the extra " as mentioned by #Andreas.
Add xs:sequence under xs:complexType in two places.
Change the type of #fat to xs:string.
Change use="choice" to use="optional".
Altogether, this XSD will successfully validate your XML:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Collection" >
<xs:complexType>
<xs:sequence>
<xs:element name="Description" type="xs:string"/>
<xs:element name="Recipe" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Title" type="xs:string"/>
<xs:element name="Ingredients">
<xs:complexType>
<xs:sequence>
<xs:element name="Ingredient" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="amount" type="xs:integer" use="required"/>
<xs:attribute name="unit" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Preparation">
<xs:complexType>
<xs:sequence>
<xs:element name="Step" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Comment" type="xs:string" minOccurs="0"/>
<xs:element name="Nutrients">
<xs:complexType>
<xs:attribute name="proteins" type="xs:integer" use="required"/>
<xs:attribute name="carbohidrati" type="xs:NMTOKEN" use="required"/>
<xs:attribute name="fat" type="xs:string" use="optional"/>
<xs:attribute name="vitamins" type="xs:NMTOKEN" use="required"/>
<xs:attribute name="calories" type="xs:float" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Of course, you will also have to check your Java code. (Hint: make sure you're not validating your XSD as XML when you really want to validating your XML against your XSD.)

Related

XSD to java beans

I am new to XSDs format. I am trying to convert one xsd to java bean using xjc.But on converting I am getting multiple beans rather than getting just one bean.How to obtain one single bean from the XSD?
Below is my xsd.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="TradeMessage" type="TradeMessageType"/>
<xs:simpleType name="empty-string">
<xs:restriction base="xs:string">
<xs:enumeration value="" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="decimal-or-empty">
<xs:union memberTypes="xs:decimal empty-string" />
</xs:simpleType>
<xs:complexType name="contractingEntityType">
<xs:sequence>
<xs:element type="tradingAccountType" name="tradingAccount"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="executingEntityType">
<xs:sequence>
<xs:element type="tradingAccountType" name="tradingAccount"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="tradeFeesType">
<xs:choice maxOccurs="unbounded" minOccurs="0">
<xs:element type="tradeFees_itemType" name="tradeFees_item"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="settlementCurrencyType">
<xs:sequence>
<xs:element type="xs:string" name="iSOCode"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="tradingAccountType">
<xs:sequence>
<xs:element type="xs:string" name="uniqueID"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="currencyType">
<xs:sequence>
<xs:element type="xs:string" name="iSOCode"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="tradingInstrumentType">
<xs:sequence>
<xs:element type="xs:string" name="CUSIP"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="tradeFees_itemType">
<xs:sequence>
<xs:element type="chargeCodeType" name="chargeCode"/>
<xs:element type="xs:string" name="inConsideration"/>
<xs:element type="currencyType" name="currency"/>
<xs:element type="xs:decimal" name="currencyValue"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="IncomingTradeMessageType">
<xs:sequence>
<xs:element type="IncomingTradeType" name="IncomingTrade"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="TradeMessageType">
<xs:sequence>
<xs:element type="IncomingTradeMessageType" name="IncomingTradeMessage"/>
</xs:sequence>
<xs:attribute type="xs:string" name="schemaVersion"/>
</xs:complexType>
<xs:complexType name="chargeCodeType">
<xs:sequence>
<xs:element type="xs:string" name="name"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="theirTradingAccountType">
<xs:sequence>
<xs:element type="xs:string" name="uniqueID"/>
<xs:element type="xs:string" name="organisationUniqueID"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="tradeCurrencyType">
<xs:sequence>
<xs:element type="xs:string" name="iSOCode"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="transactionTypeType">
<xs:sequence>
<xs:element type="xs:string" name="uniqueID"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="channelType">
<xs:sequence>
<xs:element type="xs:string" name="name"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="IncomingTradeType">
<xs:sequence>
<xs:element type="xs:string" name="blockTradeReference"/>
<xs:element type="xs:string" name="sourceReference"/>
<xs:element type="xs:string" name="sourceVersion"/>
<xs:element type="xs:decimal" name="nominal"/>
<xs:element type="xs:decimal" name="price"/>
<xs:element type="xs:string" name="tradeDate"/>
<xs:element type="xs:string" name="valueDate"/>
<xs:element type="transactionTypeType" name="transactionType"/>
<xs:element type="tradingInstrumentType" name="tradingInstrument"/>
<xs:element type="tradeCurrencyType" name="tradeCurrency"/>
<xs:element type="xs:string" name="cancelled"/>
<xs:element type="xs:string" name="tradeTime"/>
<xs:element type="tradeFeesType" name="tradeFees"/>
<xs:element type="xs:decimal" name="grossConsideration"/>
<xs:element type="xs:decimal" name="netConsideration"/>
<xs:element type="xs:decimal" name="settlementConsideration"/>
<xs:element type="settlementCurrencyType" name="settlementCurrency"/>
<xs:element type="decimal-or-empty" name="settlementExRate"/>
<xs:element type="xs:string" name="settlementExRateDirection"/>
<xs:element type="theirTradingAccountType" name="theirTradingAccount"/>
<xs:element type="executingEntityType" name="executingEntity"/>
<xs:element type="contractingEntityType" name="contractingEntity"/>
<xs:element type="decimal-or-empty" name="calculatedNetPrice"/>
<xs:element type="xs:string" name="dealingCapacity"/>
<xs:element type="xs:string" name="agreedPriceIndicator"/>
<xs:element type="xs:string" name="orderReference"/>
<xs:element type="xs:string" name="lastAmendedOnBusinessDate"/>
<xs:element type="xs:string" name="creationAsatDate"/>
<xs:element type="xs:string" name="bpsBranchAccountNumber"/>
<xs:element type="xs:string" name="bpsAccountType"/>
<xs:element type="xs:string" name="shortSell"/>
<xs:element type="decimal-or-empty" name="facilitationPercentage"/>
<xs:element type="xs:string" name="isStepOut"/>
<xs:element type="xs:string" name="stepOutBrokerMPID"/>
<xs:element type="xs:string" name="bargainConditionFO"/>
<xs:element type="channelType" name="channel"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
This XSD is giving me different beans for different properties but actually I would need just one bean comprising of all the properties. As per my requirement I would receive input message (as per above xsd) and convert it directly to java bean and use this bean for further processing. If there is some other better strategy ,kindly let me know.
This is how JAXB works. A complex schema type is mapped to a Java class, and since this schema has many complex types you get several Java classes. When unmarshalling an XML document, you'll get one TradeMessageType instance.

JaxB Unmarshall error : java.lang.RuntimeException: unexpected element (uri:"", local:"code"). Expected elements are <{}section>

please advise what may be the issue with this JAXB Unmarshall code
This is the error message I receive when I try to unmarshall the XML I have provided below:
java.lang.RuntimeException: unexpected element (uri:"", local:"code"). Expected elements are <{}section>
Borrower class is parsed using JaxB based on the XSD , using JDK 1.7 and Eclipse IDE.
:
public class UnmarshallApplication {
public static void main(String[] args) {
try {
JAXBContext jaxbContext = JAXBContext.newInstance(Borrower.class);
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
jaxbUnmarshaller.setEventHandler(new ValidationEventHandler() {
public boolean handleEvent(ValidationEvent event ) {
throw new RuntimeException(event.getMessage(),event.getLinkedException());
}
});
StringReader xmlCCR = new StringReader(returnValue2());
JAXBElement<Borrower> root = jaxbUnmarshaller.unmarshal(new StreamSource(xmlCCR), Borrower.class);
Borrower productListResponse = root.getValue();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Borrower class :
package bg.rbb.unmarshall;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
#XmlAccessorType(XmlAccessType.FIELD)
#XmlType(name = "", propOrder = {"section"})
#XmlRootElement(name = "borrower")
public class Borrower {
#XmlElement(required = true)
protected List<Section> section;
#XmlAttribute(name = "code", required = true)
protected String code;
#XmlAttribute(name = "name")
protected String name;
public List<Section> getSection() {
if (section == null) {
section = new ArrayList<Section>();
}
return this.section;
}
public String getCode() {
return code;
}
public void setCode(String value) {
this.code = value;
}
public String getName() {
return name;
}
public void setName(String value) {
this.name = value;
}
}
XSD :
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:wmh="http://www.wmhelp.com/2003/eGenerator"
elementFormDefault="qualified">
<xs:element name="borr-info-list">
<xs:complexType>
<xs:sequence>
<xs:element ref="borrower" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="req-file-name" type="xs:string"/>
<xs:attribute name="req-file-time" type="xs:string"/>
<xs:attribute name="req-file-user" type="xs:string"/>
<xs:attribute name="req-file-entity" type="xs:string"/>
<xs:attribute name="out-file-time" type="xs:string"/>
<xs:attribute name="borr_count" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="borrower">
<xs:complexType>
<xs:sequence>
<xs:element ref="section" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="code" type="xs:string" use="required"/>
<xs:attribute name="name" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="section">
<xs:complexType>
<xs:sequence>
<xs:element ref="active-credits"/>
<xs:element ref="overdue-history"/>
<xs:element ref="new-credits"/>
</xs:sequence>
<xs:attribute name="entity-type" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="active-credits">
<xs:complexType>
<xs:sequence>
<xs:element ref="summaries" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="cred-count" type="xs:string"/>
<xs:attribute name="source-entity-count" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="summaries">
<xs:complexType>
<xs:sequence>
<xs:element ref="summary" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="grouping-attribute" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="summary">
<xs:complexType>
<xs:attribute name="date-from" type="xs:string"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="amount-approved" type="xs:string"/>
<xs:attribute name="amount-drawn" type="xs:string"/>
<xs:attribute name="monthly-installment" type="xs:string"/>
<xs:attribute name="outstanding-performing-principal" type="xs:string"/>
<xs:attribute name="outstanding-overdue-principal" type="xs:string"/>
<xs:attribute name="balance-sheet-value" type="xs:string"/>
<xs:attribute name="off-balance-sheet-value" type="xs:string"/>
<xs:attribute name="overdue-payment-period" type="xs:string"/>
<xs:attribute name="rest" type="xs:string"/>
<xs:attribute name="term" type="xs:string"/>
<xs:attribute name="active" type="xs:string"/>
<xs:attribute name="year" type="xs:string"/>
<xs:attribute name="category" type="xs:string"/>
<xs:attribute name="months-count" type="xs:string"/>
<xs:attribute name="max-cred-count" type="xs:string"/>
<xs:attribute name="max-outstanding-overdue-principal" type="xs:string"/>
<xs:attribute name="max-outstanding-overdue-interest-and-others"
type="xs:string"/>
<xs:attribute name="max-off-balance-sheet-dues" type="xs:string"/>
<xs:attribute name="date-last-correction" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="overdue-history">
<xs:complexType>
<xs:sequence>
<xs:element ref="summary" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="new-credits">
<xs:complexType>
<xs:sequence>
<xs:element ref="summary" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
XML :
<?xml version="1.0" encoding="UTF-8"?>
<borrower>
<code>7777777777</code>
<name>FirstName Surname LastName</name>
<section>
<entity-type>banks</entity-type>
<active-credits>
<cred-count>2</cred-count>
<source-entity-count>1</source-entity-count>
<summaries>
<grouping-attribute>type</grouping-attribute>
<summary>
<date-from>2017-12-31</date-from>
<type>Card</type>
<amount-approved>4000</amount-approved>
<amount-drawn>2105</amount-drawn>
<monthly-installment>0</monthly-installment>
<outstanding-performing-principal>2105</outstanding-performing-principal>
<outstanding-overdue-principal>0</outstanding-overdue-principal>
<balance-sheet-value>2105</balance-sheet-value>
<off-balance-sheet-value>1895</off-balance-sheet-value>
</summary>
<summary>
<date-from>2017-12-31</date-from>
<type>Овърдрафт</type>
<amount-approved>7434</amount-approved>
<amount-drawn>7447</amount-drawn>
<monthly-installment>0</monthly-installment>
<outstanding-performing-principal>7434</outstanding-performing-principal>
<outstanding-overdue-principal>13</outstanding-overdue-principal>
<balance-sheet-value>7484</balance-sheet-value>
<off-balance-sheet-value>0</off-balance-sheet-value>
</summary>
</summaries>
<summaries>
<grouping-attribute>overdue-payment-period</grouping-attribute>
<summary>
<date-from>2017-12-31</date-from>
<overdue-payment-period>от 0 до 30 дни</overdue-payment-period>
<amount-approved>11434</amount-approved>
<amount-drawn>9552</amount-drawn>
<monthly-installment>0</monthly-installment>
<outstanding-performing-principal>9539</outstanding-performing-principal>
<outstanding-overdue-principal>13</outstanding-overdue-principal>
<balance-sheet-value>9589</balance-sheet-value>
<off-balance-sheet-value>1895</off-balance-sheet-value>
</summary>
</summaries>
<summaries>
<grouping-attribute>rest</grouping-attribute>
<summary>
<date-from>2017-12-31</date-from>
<rest>До една година</rest>
<amount-approved>7434</amount-approved>
<amount-drawn>7447</amount-drawn>
<monthly-installment>0</monthly-installment>
<outstanding-performing-principal>7434</outstanding-performing-principal>
<outstanding-overdue-principal>13</outstanding-overdue-principal>
<balance-sheet-value>7484</balance-sheet-value>
<off-balance-sheet-value>0</off-balance-sheet-value>
</summary>
<summary>
<date-from>2017-12-31</date-from>
<rest>Над една година</rest>
<amount-approved>4000</amount-approved>
<amount-drawn>2105</amount-drawn>
<monthly-installment>0</monthly-installment>
<outstanding-performing-principal>2105</outstanding-performing-principal>
<outstanding-overdue-principal>0</outstanding-overdue-principal>
<balance-sheet-value>2105</balance-sheet-value>
<off-balance-sheet-value>1895</off-balance-sheet-value>
</summary>
</summaries>
<summaries>
<grouping-attribute>term</grouping-attribute>
<summary>
<date-from>2017-12-31</date-from>
<term>Над една година</term>
<amount-approved>11434</amount-approved>
<amount-drawn>9552</amount-drawn>
<monthly-installment>0</monthly-installment>
<outstanding-performing-principal>9539</outstanding-performing-principal>
<outstanding-overdue-principal>13</outstanding-overdue-principal>
<balance-sheet-value>9589</balance-sheet-value>
<off-balance-sheet-value>1895</off-balance-sheet-value>
</summary>
</summaries>
</active-credits>
<overdue-history />
<new-credits />
</section>
</borrower>
The problem is the xsd (and thus the generated POJOs) and the xml do not match.
For example, as you can see in the Borrower class, name and code are annotated with #XmlAttribute but your xml does not have them as attributes but as elements instead.
To be more specific your xml looks like this:
<borrower>
<code>7777777777</code>
<name>FirstName Surname LastName</name>
<section>
...
</borrower>
But the POJO is built to expect something like this (focusing only on code and name):
<borrower code="someCode" name="someName">
<section>
...
</borrower>
and continuing on there are more similar issues. So we have to fix your xsd. Is it under your control?
If you change your xsd to the one below, you will be able to unmarshal.
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:wmh="http://www.wmhelp.com/2003/eGenerator"
elementFormDefault="qualified">
<xs:element name="borr-info-list">
<xs:complexType>
<xs:sequence>
<xs:element ref="borrower" maxOccurs="unbounded"/>
<xs:element name="req-file-name" type="xs:string"/>
<xs:element name="req-file-time" type="xs:string"/>
<xs:element name="req-file-user" type="xs:string"/>
<xs:element name="req-file-entity" type="xs:string"/>
<xs:element name="out-file-time" type="xs:string"/>
<xs:element name="borr_count" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="borrower">
<xs:complexType>
<xs:sequence>
<xs:element ref="section" maxOccurs="unbounded"/>
<xs:element name="code" type="xs:string"/>
<xs:element name="name" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="section">
<xs:complexType>
<xs:sequence>
<xs:element ref="active-credits"/>
<xs:element ref="overdue-history"/>
<xs:element ref="new-credits"/>
<xs:element name="entity-type" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="active-credits">
<xs:complexType>
<xs:sequence>
<xs:element ref="summaries" maxOccurs="unbounded"/>
<xs:element name="cred-count" type="xs:string"/>
<xs:element name="source-entity-count" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="summaries">
<xs:complexType>
<xs:sequence>
<xs:element ref="summary" maxOccurs="unbounded"/>
<xs:element name="grouping-attribute" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="summary">
<xs:complexType>
<xs:sequence>
<xs:element name="date-from" type="xs:string"/>
<xs:element name="type" type="xs:string"/>
<xs:element name="amount-approved" type="xs:string"/>
<xs:element name="amount-drawn" type="xs:string"/>
<xs:element name="monthly-installment" type="xs:string"/>
<xs:element name="outstanding-performing-principal" type="xs:string"/>
<xs:element name="outstanding-overdue-principal" type="xs:string"/>
<xs:element name="balance-sheet-value" type="xs:string"/>
<xs:element name="off-balance-sheet-value" type="xs:string"/>
<xs:element name="overdue-payment-period" type="xs:string"/>
<xs:element name="rest" type="xs:string"/>
<xs:element name="term" type="xs:string"/>
<xs:element name="active" type="xs:string"/>
<xs:element name="year" type="xs:string"/>
<xs:element name="category" type="xs:string"/>
<xs:element name="months-count" type="xs:string"/>
<xs:element name="max-cred-count" type="xs:string"/>
<xs:element name="max-outstanding-overdue-principal" type="xs:string"/>
<xs:element name="max-outstanding-overdue-interest-and-others"
type="xs:string"/>
<xs:element name="max-off-balance-sheet-dues" type="xs:string"/>
<xs:element name="date-last-correction" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="overdue-history">
<xs:complexType>
<xs:sequence>
<xs:element ref="summary" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="new-credits">
<xs:complexType>
<xs:sequence>
<xs:element ref="summary" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

Java XML Schema Validation elementFormDefault="qualified"

I have a XSD:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified"
elementFormDefault="qualified">
<xs:element name="Structure">
<xs:annotation>
<xs:documentation>Comment describing your root element</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="Tag1"/>
<xs:element maxOccurs="unbounded" minOccurs="0" ref="Tag2"/>
<xs:element minOccurs="0" ref="Properties"/>
<xs:element minOccurs="0" ref="Tag3"/>
</xs:sequence>
<xs:attribute name="url"/>
</xs:complexType>
</xs:element>
<xs:element name="Tag1">
<xs:complexType>
<xs:attribute name="attr"/>
<xs:attribute name="attr2"/>
</xs:complexType>
</xs:element>
<xs:element name="Tag2">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element minOccurs="0" ref="Object"/>
<xs:element maxOccurs="unbounded" minOccurs="0" ref="Tag2"/>
</xs:sequence>
<xs:attribute name="filter"/>
</xs:complexType>
</xs:element>
<xs:element name="Object">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="tag35">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:element maxOccurs="unbounded" minOccurs="0" ref="Tag3"/>
</xs:sequence>
<xs:attribute name="attr4"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="attr48"/>
</xs:complexType>
</xs:element>
<xs:element name="element52">
<xs:annotation>
<xs:documentation>Text54</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="el58"/>
</xs:sequence>
<xs:attribute name="vector"/>
</xs:complexType>
</xs:element>
<xs:element name="el66" type="el66Type"/>
<xs:element name="el58">
<xs:complexType mixed="true">
<xs:attribute name="ID" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="Tag3">
<xs:complexType>
<xs:sequence maxOccurs="unbounded" minOccurs="0">
<xs:element minOccurs="0" name="MetaProperty">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:any/>
</xs:sequence>
<xs:attribute name="name"/>
<xs:attribute name="value"/>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" ref="Property"/>
</xs:sequence>
<xs:attribute name="ID"/>
<xs:attribute name="language" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="Property">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:any minOccurs="0" processContents="skip"/>
</xs:sequence>
<xs:attribute name="name"/>
<xs:attribute name="type"/>
</xs:complexType>
</xs:element>
<xs:element name="Properties">
<xs:complexType>
<xs:sequence maxOccurs="unbounded" minOccurs="0">
<xs:element minOccurs="0" ref="Property"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType mixed="true" name="el66Type">
<xs:attribute name="ID" type="xs:string"/>
</xs:complexType>
</xs:schema>
And an xml:
<Structure url="/Test/url">
<Tag1/>
<Tag2>
<Object>
<tag35/>
</Object>
</Tag2>
<Properties>
<Property name="bla" type="value1"/>
<Property name="bla2" type="value2"/>
</Properties>
</Structure>
I am doing a validation, and I am getting the following error:
org.xml.sax.SAXParseException; cvc-complex-type.2.4.a: Invalid content was found starting with element 'Tag2'. One of '{Tag1, Tag2, Tag3}' is expected.
I checked in previous questions and always the solution is related with elementFormDefault="qualified" but now it is not the case so, could it be possible that there is a bug there? Any clue, will be grateful.
Your XML is valid against your XSD as posted in your question.
The error message in your question would not be returned. It must have been from different XML or XSD documents.
As Michael Kay states in the comments:
elementFormDefault only affects local elements declarations.
elementFormDefault only comes into play when the XSD has a targetNamespace.
For more details about elementFormDefault see this answer.

Spring - Xsd file with constructor

I have an entity class auto-generated from xsd file;
the problem is that it hasn't any constructor and I must add it manual.
How can I specify a constructor?
Here my xsd file:
entities.xsd
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://capgemini.it/soap/entity/generated"
targetNamespace="http://capgemini.it/soap/entity/generated" elementFormDefault="qualified">
<xs:element name="getEntityRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getEntityResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="entity" type="tns:entity"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="entity">
<xs:sequence>
<xs:element name="firstName" type="xs:string"/>
<xs:element name="lastName" type="xs:string"/>
<xs:element name="cf" type="xs:string"/>
<xs:element name="role" type="xs:string"/>
<xs:element name="valid" type="xs:boolean"/>
<xs:element name="isIta" type="xs:boolean"/>
<xs:element name="sesso" type="xs:boolean"/>
<xs:element name="nationalNumber" type="xs:string"/>
<xs:element name="crs" type="xs:string"/>
<xs:element name="lvlId" type="xs:int"/>
<xs:element name="qual" type="xs:string"/>
</xs:sequence>
</xs:complexType>
Thanks for any suggestion :)

JAXB- Not able to bind this xsd to java objects

I am using HyperJAXB sample code of purchase order from http://confluence.highsource.org/display/HJ3/Purchase+Order+Tutorial This example works fine for me. I Am able to create java objects from XSD and persist it into DB. Now I am trying with my XML and XSD.
I am not able to bind following xsd using JAXB. I am using eclipse built in tool as well as HyperJAXB, but both failed to parse my XSD.
I have generated this xsd from xml using online tool: http://www.freeformatter.com/xsd-generator.html
There are multiple problems:
xml:lang=" en-us - gives an eror for this and even if we remove this, there is problem in binding.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:testCompile (default-testCompile) on project hyperjaxb3-ejb-template-basic-maven: Comp
ilation failure: Compilation failure:
[ERROR] E:\App\SampleCode\hyperjaxb3-ejb-template-basic-0.5.6-maven-src\hyperjaxb3-ejb-template-basic-0.5.6\target\generated-sources\xjc\generated\CXML.java:[599,7] error
: duplicate class: generated.CXML
[ERROR] E:\App\SampleCode\hyperjaxb3-ejb-template-basic-0.5.6-maven-src\hyperjaxb3-ejb-template-basic-0.5.6\src\test\java\generated\ObjectFactory.java:[32,7] error: dupli
cate class: generated.ObjectFactory
It generates only two classes, not rest of classes
generated\CXML.java
generated\ObjectFactory.java
Can someone help me making this XSD to bind successfully and generate java objects out of it.
XSD:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified">
<xs:element name="cXML">
<xs:complexType>
<xs:sequence>
<xs:element name="Header">
<xs:complexType>
<xs:sequence>
<xs:element name="From">
<xs:complexType>
<xs:sequence>
<xs:element name="Credential">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="Identity"/>
</xs:sequence>
<xs:attribute type="xs:string" name="domain"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="To">
<xs:complexType>
<xs:sequence>
<xs:element name="Credential">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="Identity"/>
</xs:sequence>
<xs:attribute type="xs:string" name="domain"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Sender">
<xs:complexType>
<xs:sequence>
<xs:element name="Credential">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="Identity"/>
</xs:sequence>
<xs:attribute type="xs:string" name="domain"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Request">
<xs:complexType>
<xs:sequence>
<xs:element name="OrderRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="OrderRequestHeader">
<xs:complexType>
<xs:choice maxOccurs="unbounded" minOccurs="0">
<xs:element name="ID">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:short">
<xs:attribute type="xs:string" name="domain"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Total">
<xs:complexType>
<xs:sequence>
<xs:element name="Money">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:float">
<xs:attribute type="xs:string" name="currency"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Shipping">
<xs:complexType>
<xs:sequence>
<xs:element name="Money">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:float">
<xs:attribute type="xs:string" name="currency"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Description">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute ref="xml:lang"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Tax">
<xs:complexType>
<xs:sequence>
<xs:element name="Money">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:float">
<xs:attribute type="xs:string" name="currency"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Extrinsic">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:string" name="name"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="BillTo">
<xs:complexType mixed="true">
<xs:sequence>
<xs:element name="Address" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="CompanyName"/>
<xs:element name="ContactId">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:int">
<xs:attribute type="xs:string" name="domain"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element type="xs:string" name="PaymentType"/>
<xs:element name="PostalAddress">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="FirstName"/>
<xs:element type="xs:string" name="LastName"/>
<xs:element type="xs:string" name="Street"/>
<xs:element type="xs:string" name="City"/>
<xs:element type="xs:string" name="State"/>
<xs:element name="Country">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:string" name="isoCountryCode"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element type="xs:int" name="PostalCode"/>
<xs:element type="xs:string" name="Email"/>
<xs:element type="xs:long" name="WorkPhone"/>
</xs:sequence>
<xs:attribute type="xs:string" name="name"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:int" name="contactId"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:string" name="name" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="Contact">
<xs:complexType>
<xs:sequence>
<xs:element name="ID">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:string" name="domain"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element type="xs:string" name="Name"/>
<xs:element type="xs:string" name="Email"/>
<xs:element type="xs:string" name="Company"/>
<xs:element type="xs:string" name="Department"/>
</xs:sequence>
<xs:attribute type="xs:string" name="Role"/>
</xs:complexType>
</xs:element>
</xs:choice>
<xs:attribute type="xs:string" name="orderDate"/>
<xs:attribute type="xs:string" name="type"/>
</xs:complexType>
</xs:element>
<xs:element name="ItemOut">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="Type"/>
<xs:element name="ItemId">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:int">
<xs:attribute type="xs:string" name="domain"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element type="xs:string" name="StatusType"/>
<xs:element name="PostageAmount">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:float">
<xs:attribute type="xs:string" name="currency"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Discount">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:float">
<xs:attribute type="xs:string" name="currency"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element type="xs:string" name="orderItemName"/>
<xs:element type="xs:string" name="orderItemDescription"/>
<xs:element type="xs:float" name="Price"/>
<xs:element name="ItemID">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="SupplierPartID"/>
<xs:element type="xs:string" name="SupplierPartAuxiliaryID"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ItemDetail">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="URL"/>
<xs:element name="Description">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute ref="xml:lang"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="UnitPrice">
<xs:complexType>
<xs:sequence>
<xs:element name="Money">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:float">
<xs:attribute type="xs:string" name="currency"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element type="xs:string" name="UnitOfMeasure"/>
<xs:element name="Extrinsic">
<xs:complexType>
<xs:sequence>
<xs:element name="ul">
<xs:complexType>
<xs:sequence>
<xs:element name="li" maxOccurs="unbounded" minOccurs="0">
<xs:complexType mixed="true">
<xs:sequence>
<xs:element type="xs:float" name="span"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:string" name="name"/>
</xs:complexType>
</xs:element>
<xs:element name="Classification">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:string" name="domain"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element type="xs:string" name="ManufacturerPartID"/>
<xs:element name="ManufacturerName">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute ref="xml:lang"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ShipTo">
<xs:complexType>
<xs:sequence>
<xs:element name="Address">
<xs:complexType>
<xs:sequence>
<xs:element name="ContactId">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:int">
<xs:attribute type="xs:string" name="domain"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element type="xs:string" name="CompanyName"/>
<xs:element name="PostalAddress">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="FirstName"/>
<xs:element type="xs:string" name="LastName"/>
<xs:element type="xs:string" name="Street"/>
<xs:element type="xs:string" name="City"/>
<xs:element type="xs:string" name="State"/>
<xs:element name="Country">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:string" name="isoCountryCode"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element type="xs:int" name="PostalCode"/>
<xs:element type="xs:string" name="Email"/>
<xs:element type="xs:long" name="WorkPhone"/>
</xs:sequence>
<xs:attribute type="xs:string" name="name"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:int" name="contactId"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Shipping">
<xs:complexType>
<xs:sequence>
<xs:element name="Money">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:float">
<xs:attribute type="xs:string" name="currency"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Description">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute ref="xml:lang"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Distribution" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="Accounting">
<xs:complexType>
<xs:sequence>
<xs:element name="AccountingSegment" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="Name">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute ref="xml:lang"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Description">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute ref="xml:lang"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:string" name="id" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:string" name="name" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="Charge">
<xs:complexType>
<xs:sequence>
<xs:element name="Money">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:string" name="currency" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Comments">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute ref="xml:lang"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:byte" name="quantity"/>
<xs:attribute type="xs:byte" name="lineNumber"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:string" name="payloadID"/>
<xs:attribute type="xs:string" name="timestamp"/>
<xs:attribute ref="xml:lang"/>
</xs:complexType>
</xs:element>
</xs:schema>
XML:
<cXML payloadID="7ece55bf-8af9-42c4-9f5b-613ac5e00819" timestamp="12/4/2014 4:51:22 PM" xml:lang=" en-us ">
<Header>
<From>
<Credential domain="web">
<Identity>UAT Master</Identity>
</Credential>
</From>
<To>
<Credential domain="web">
<Identity>notused</Identity>
</Credential>
</To>
<Sender>
<Credential domain="web">
<Identity>notused</Identity>
</Credential>
</Sender>
</Header>
<Request>
<OrderRequest>
<OrderRequestHeader orderDate="12/4/2014 4:51:22 PM" type="new">
<ID domain="Web">645</ID>
<Total>
<Money currency="USD">129.48</Money>
</Total>
<Shipping>
<Money currency="USD">12.57</Money>
<Description xml:lang="en-US"/>
</Shipping>
<Tax>
<Money currency="USD">8.91</Money>
</Tax>
<Extrinsic name="Additional Comments or Instructions:"/>
<BillTo>
<Address contactId="210306">
<CompanyName>UAT Master</CompanyName>
<ContactId domain="Web">210306</ContactId>
<PaymentType>CREDITCARD</PaymentType>
<PostalAddress name="default">
<FirstName>test</FirstName>
<LastName>test</LastName>
<Street>Hills Road</Street>
<City>NYC</City>
<State>NY</State>
<Country isoCountryCode="USA">USA</Country>
<PostalCode>78759</PostalCode>
<Email>test#test.com</Email>
<WorkPhone>2342423434</WorkPhone>
</PostalAddress>
</Address>
</BillTo>
<Extrinsic name="Purchase Order Number:"/>
<Contact Role="buyer">
<ID domain="Web">John</ID>
<Name>John M</Name>
<Email>test#test.com</Email>
<Company>UAT Master</Company>
<Department/>
</Contact>
</OrderRequestHeader>
<ItemOut quantity="120" lineNumber="1">
<Type>PRINT</Type>
<ItemId domain="Web">210300</ItemId>
<StatusType>APPROVED</StatusType>
<PostageAmount currency="USD">0.00</PostageAmount>
<Discount currency="USD">0.00</Discount>
<orderItemName>cxml test for cc payment</orderItemName>
<orderItemDescription>test cxml only with cc payment</orderItemDescription>
<Price>108.00</Price>
<ItemID>
<SupplierPartID>BUSCRD001</SupplierPartID>
<SupplierPartAuxiliaryID/>
</ItemID>
<ItemDetail>
<URL>
http://47.59.13.45/ACV3UATRepo/NgA=/MQAzADUAOAAwAA==/2012/3/28/someImage==.jpg
</URL>
<Description xml:lang="en-US">Business Card</Description>
<UnitPrice>
<Money currency="USD">0.90</Money>
</UnitPrice>
<UnitOfMeasure>PER_PIECE</UnitOfMeasure>
<Extrinsic name="options">
<ul>
<li>
Envelope Color/Yellow=
<span>0.00</span>
</li>
<li>
Paper Type/Gloss=
<span>0.00</span>
</li>
</ul>
</Extrinsic>
<Classification domain=""/>
<ManufacturerPartID/>
<ManufacturerName xml:lang="en-US"/>
</ItemDetail>
<ShipTo>
<Address contactId="210301">
<ContactId domain="Web">210301</ContactId>
<CompanyName>UAT Master</CompanyName>
<PostalAddress name="default">
<FirstName>test</FirstName>
<LastName>test</LastName>
<Street>Hills Road</Street>
<City>NYC</City>
<State>NY</State>
<Country isoCountryCode="USA">USA</Country>
<PostalCode>78759</PostalCode>
<Email>test#test.com</Email>
<WorkPhone>2342423434</WorkPhone>
</PostalAddress>
</Address>
</ShipTo>
<Shipping>
<Money currency="USD">12.57</Money>
<Description xml:lang="en-US">Fedex Ground</Description>
</Shipping>
<Distribution>
<Accounting name="DistributionCharge">
<AccountingSegment id="">
<Name xml:lang="en-US"/>
<Description xml:lang="en-US"/>
</AccountingSegment>
<AccountingSegment id="">
<Name xml:lang="en-US"/>
<Description xml:lang="en-US"/>
</AccountingSegment>
</Accounting>
<Charge>
<Money currency="USD"/>
</Charge>
</Distribution>
<Distribution>
<Accounting name="DistributionCharge">
<AccountingSegment id="">
<Name xml:lang="en-US"/>
<Description xml:lang="en-US"/>
</AccountingSegment>
<AccountingSegment id="">
<Name xml:lang="en-US"/>
<Description xml:lang="en-US"/>
</AccountingSegment>
</Accounting>
<Charge>
<Money currency="USD"/>
</Charge>
</Distribution>
<Comments xml:lang="en-US"/>
</ItemOut>
</OrderRequest>
</Request>
</cXML>

Categories