Custom xsd document validation referencing child xsd via import/include
Hi,
I need to build an ebXML 2.0 agreement which will use multiple xsd's. I have a root xsd document(Company.xsd) which imports two child xsd document(Product.xsd and Person.xsd).
I've validated the xsd's and it seems to work. I even built a composite process and it works.
The problem is when I use it in B2B Gateway 11g. I get an error saying it cannot validate against the xsd.
I followed a thread Re: ebMS with custom xsd document which import other xsd's that tells me that
I should ZIP it(all top level) and use the zipfile as the document definition and specify the root xsd(Company.xsd). Zipping it with just basic one level
xsd seems to work but not multi level.
Are multiple level xsd supported in B2B 11g?
Regards,
Robert
P.S.
I've attached the xsd and sample xml data.
--- Company.xsd----
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.company.org" xmlns:per="http://www.person.org" xmlns:pro="http://www.product.org" targetNamespace="http://www.company.org" elementFormDefault="unqualified">
<xsd:import namespace="http://www.person.org" schemaLocation="Person.xsd"/>
<xsd:import namespace="http://www.product.org" schemaLocation="Product.xsd"/>
<xsd:element name="Company">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Person" type="per:PersonType" maxOccurs="unbounded"/>
<xsd:element name="Product" type="pro:ProductType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
--- Person.xsd----
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.person.org"
xmlns="http://www.person.org"
elementFormDefault="unqualified">
<xsd:complexType name="PersonType">
<xsd:sequence>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="SSN" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
---- Product.xsd----
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.product.org"
xmlns="http://www.product.org"
elementFormDefault="unqualified">
<xsd:complexType name="ProductType">
<xsd:sequence>
<xsd:element name="Type" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
----Sample XML Data----
<?xml version="1.0" encoding="UTF-8"?>
<n1:Company xsi:schemaLocation="http://www.company.org Company.xsd" xmlns:n1="http://www.company.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Person>
<Name>MyName</Name>
<SSN>12345</SSN>
</Person>
<Product>
<Type>TheProduct</Type>
</Product>
</n1:Company>
Edited by: RSamaniego on 30/08/2010 14:14
This is the error I'm getting. I got this from the soa-server1-diagnostic file.
[2010-08-31T08:46:54.209+12:00] [soa_server1] [ERROR] [] [oracle.soa.b2b.engine] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@1e84d54] [userId: <anonymous>] [ecid: 0000If4kAAfECSIMyqqYMG1CV1Rh000033,0] [APP: soa-infra] [dcid: e89d49f26b5a6f2c:11cf61b2:12ac4ba60b9:-7ffd-000000000000002b] oracle.xml.parser.v2.XMLParseException: Element 'Name' not expected.[[
at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:323)
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:342)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:319)
at oracle.tip.b2b.document.custom.CustomDocumentPlugin.processDocument(CustomDocumentPlugin.java:896)
at oracle.tip.b2b.document.custom.CustomDocumentPlugin.processOutgoingDocument(CustomDocumentPlugin.java:438)
at oracle.tip.b2b.msgproc.Request.outgoingRequestPostColab(Request.java:1326)
at oracle.tip.b2b.msgproc.Request.outgoingRequest(Request.java:837)
at oracle.tip.b2b.engine.Engine.processOutgoingMessageImpl(Engine.java:1411)
at oracle.tip.b2b.engine.Engine.processOutgoingMessage(Engine.java:781)
at oracle.tip.b2b.engine.Engine.handleMessageEvent(Engine.java:3319)
at oracle.tip.b2b.engine.Engine.processEvents(Engine.java:2948)
at oracle.tip.b2b.engine.ThreadWorkExecutor.processEvent(ThreadWorkExecutor.java:575)
at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:214)
at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:105)
at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
oracle.xml.parser.v2.XMLParseException: Element 'Name' not expected.
at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:323)
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:342)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:319)
at oracle.tip.b2b.document.custom.CustomDocumentPlugin.processDocument(CustomDocumentPlugin.java:896)
at oracle.tip.b2b.document.custom.CustomDocumentPlugin.processOutgoingDocument(CustomDocumentPlugin.java:438)
at oracle.tip.b2b.msgproc.Request.outgoingRequestPostColab(Request.java:1326)
at oracle.tip.b2b.msgproc.Request.outgoingRequest(Request.java:837)
at oracle.tip.b2b.engine.Engine.processOutgoingMessageImpl(Engine.java:1411)
at oracle.tip.b2b.engine.Engine.processOutgoingMessage(Engine.java:781)
at oracle.tip.b2b.engine.Engine.handleMessageEvent(Engine.java:3319)
at oracle.tip.b2b.engine.Engine.processEvents(Engine.java:2948)
at oracle.tip.b2b.engine.ThreadWorkExecutor.processEvent(ThreadWorkExecutor.java:575)
at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:214)
at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:105)
at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
Edited by: RSamaniego on 30/08/2010 13:57
Similar Messages
-
AIP-13978: Error - the input xsd fails validation
Hi,
For an ebXML setup over Generic exchange. I have to perform validation against XSDs which are nested in structure.
So while setting up the Document definition in the Business action, I uploaded the files as zip files and provided the name of the root XSD file.
However on clicking finish the for business action I am getting the IP-13978: Error - the input xsd fails validation: java.lang.NullPointerException
In the log file error message is as given:
2007.03.12 at 14:40:16:093: AJPRequestHandler-ApplicationServerThread-5: BusinessLogicLayer - (ERROR) java.lang.NullPointerException
at oracle.tip.buslogic.datatypeimport.b2b.XMLSchemaImport.getXSDElement(XMLSchemaImport.java:259)
at oracle.tip.buslogic.datatypeimport.b2b.XMLSchemaImport.importXSD(XMLSchemaImport.java:609)
at oracle.tip.buslogic.datatypeimport.b2b.XMLSchemaImport.importZipFile(XMLSchemaImport.java:426)
at oracle.tip.buslogic.bll.b2b.GenericWizard.createNativeDatatype(GenericWizard.java:452)
at oracle.tip.buslogic.bll.b2b.DocumentProtocolWizard.createDocumentDefinition(DocumentProtocolWizard.java:1228)
at oracle.tip.buslogic.bll.b2b.DocumentProtocolWizard.createDocumentDefinition(DocumentProtocolWizard.java:1061)
at oracle.tip.tools.integration.buslogic.b2b.collaboration.CreateBusinessActionFinishEventHandler.performExtendedActions(CreateBusinessActionFinishEventHandler.java:245)
at oracle.tip.tools.integration.event.IPBaseUnboundEventHandler.performActions(IPBaseUnboundEventHandler.java:88)
at oracle.tip.tools.integration.event.IPEventHandler.handleEventIP(IPEventHandler.java:138)
at oracle.tip.tools.integration.event.IPEventHandler.handleEvent(IPEventHandler.java:104)
at oracle.cabo.servlet.event.TableEventHandler.handleEvent(Unknown Source)
at oracle.cabo.servlet.event.TableEventHandler.handleEvent(Unknown Source)
at oracle.cabo.servlet.event.BasePageFlowEngine.handleRequest(Unknown Source)
at oracle.cabo.servlet.AbstractPageBroker.handleRequest(Unknown Source)
at oracle.cabo.servlet.ui.BaseUIPageBroker.handleRequest(Unknown Source)
at oracle.cabo.servlet.PageBrokerHandler.handleRequest(Unknown Source)
at oracle.cabo.servlet.UIXServlet.doGet(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:224)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:133)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:534)
2007.03.12 at 14:40:16:093: AJPRequestHandler-ApplicationServerThread-5: UI - (ERROR) oracle.tip.tools.integration.buslogic.b2b.collaboration.CreateBusinessActionFinishEventHandler.handleEvent(): Error -: AIP-13978: Error - the input xsd fails validation: java.lang.NullPointerException
Please let me know to resolve this issue.
Thanks,
GauthamPlease check the root xsd and it its dependent XSD are present
-
Getting an Out of memory exception while validating XML against XSD
Hello friends,
I am getting an Out Of Memory exception while validating my XML against a given XSd which is huge.
SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
saxParserFactory.setValidating(true);
SAXParser saxParser = saxParserFactory.newSAXParser();
saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource",new File("C:/todelxsd.xsd")); as u may see the darkened code. this basically Loads the XSD in Memmory , and JVM throws an out of Memory exception. is there any other way round of validating an XML against an XSD where i dont have to load my XSD if not then kindly let me know the solution for above problem .
Thanks.Yes, but increasing the heap size is a temporary solution , isnt there a way where the XML can be validated against an XSD without having to load XSD in memory
-
Uniqueness for xml element is not validated with the xsd:unique
Hi
I am using <xsd:unique> to specify uniqueness for certain elements in the schema. But when i create the xml for the schema,it allows me to create elements with duplicate values for which the uniqueness is defined and also it is allowed to parse the xml correctly.I am using jaxb2.0 and jaxp2.0 to bind the xml and parse it. The schema is described below :
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:include schemaLocation="ArtifactDetails.xsd" />
<xsd:element name="EKMArtifacts">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Artifact" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ArtifactType" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="ArtifactName" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="Status" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="VersionString" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="Artifactdesc" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="Functionaldesc" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="Department" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="Location" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="Rated" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="Category" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="Createdby" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="OSPlatform" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="APPPlatform" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="Country" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="State" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="Vendor" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element ref="ArtifactDetails" minOccurs="0" maxOccurs="1" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:unique name="ArtifactNameUnique">
<xsd:selector xpath="Artifact" />
<xsd:field xpath="ArtifactName" />
</xsd:unique>
</xsd:element>
</xsd:schema>
Can anyone help me out
Thanks in advanceWell there's nothing wrong with your schema (I copyied it into XMLSpy and wasn't able to create two artifacts with the same name). My guess is that JAXB still does not support xsd:unqiue
http://www.onjava.com/pub/a/onjava/2004/12/15/jaxb.html -
I'm trying to validate a xml file with this schema:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.jeromedroz.org/etc/lexicon.xsd"
targetNamespace="http://www.jeromedroz.org/etc/lexicon.xsd">
<xsd:element name="lexicon">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="available-languages" minOccurs="1"
maxOccurs="1"/>
<xsd:element ref="term" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="optional" />
</xsd:complexType>
<xsd:key name="termPK">
<xsd:selector xpath="./term" />
<xsd:field xpath="@id" />
</xsd:key>
<xsd:keyref name="termFK" refer="termPK">
<xsd:selector xpath="./term/include" />
<xsd:field xpath="@idref" />
</xsd:keyref>
</xsd:element>
<xsd:element name="available-languages">
<xsd:complexType>
<xsd:sequence maxOccurs="unbounded">
<xsd:element ref="language" minOccurs="1" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="language">
<xsd:complexType>
<xsd:attribute name="value" type="xsd:string" use="required" />
<xsd:attribute name="default" type="xsd:boolean" use="optional" />
</xsd:complexType>
</xsd:element>
<xsd:element name="term">
<xsd:complexType mixed="true">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:any namespace="http://www.w3.org/1999/xhtml"
processContents="skip" />
<xsd:element ref="translation" />
<xsd:element ref="include" />
</xsd:choice>
<xsd:attribute name="id" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
<xsd:element name="translation">
<xsd:complexType mixed="true">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:any namespace="http://www.w3.org/1999/xhtml"
processContents="skip" />
<xsd:element ref="include" />
</xsd:choice>
<xsd:attribute name="language" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
<xsd:element name="include">
<xsd:complexType>
<xsd:attribute name="idref" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:schema>And here is a portion of my xml file:
<?xml version="1.0" encoding="UTF-8"?>
<lexicon xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.jeromedroz.org/etc/lexicon.xsd
./lexicon.xsd"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.jeromedroz.org/etc/lexicon.xsd"
name="lexicon">
<available-languages>
<language value="fr" default="true" />
<language value="en" />
</available-languages>
<term id="include-this">
<translation language="fr">inclure cela</translation>
<translation language="en">include this</translation>
</term>
<term id="home">
<html:a href="http://www.mysite.org">
<translation language="fr">accueil</translation>
<include idref="include-this" />
</html:a>
</term>
</lexicon>The idref attribute of the include tag is a reference to the id attribute of the term tag. The problem is the key and keyref definition in the xsd file: for example, if a term appears more than once (with the same id) the parser should notice it because the key is duplicated, but it doesn't. I've tried several places for the key and keyref definition in the xsd file but I get an error like KeyRefOutOfScope nearly all the time. Do anybody have a solution?I'm trying to validate a xml file with this schema:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.jeromedroz.org/etc/lexicon.xsd"
targetNamespace="http://www.jeromedroz.org/etc/lexicon.xsd">
<xsd:element name="lexicon">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="available-languages" minOccurs="1"
maxOccurs="1"/>
<xsd:element ref="term" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="optional" />
</xsd:complexType>
<xsd:key name="termPK">
<xsd:selector xpath="./term" />
<xsd:field xpath="@id" />
</xsd:key>
<xsd:keyref name="termFK" refer="termPK">
<xsd:selector xpath="./term/include" />
<xsd:field xpath="@idref" />
</xsd:keyref>
</xsd:element>
<xsd:element name="available-languages">
<xsd:complexType>
<xsd:sequence maxOccurs="unbounded">
<xsd:element ref="language" minOccurs="1" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="language">
<xsd:complexType>
<xsd:attribute name="value" type="xsd:string" use="required" />
<xsd:attribute name="default" type="xsd:boolean" use="optional" />
</xsd:complexType>
</xsd:element>
<xsd:element name="term">
<xsd:complexType mixed="true">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:any namespace="http://www.w3.org/1999/xhtml"
processContents="skip" />
<xsd:element ref="translation" />
<xsd:element ref="include" />
</xsd:choice>
<xsd:attribute name="id" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
<xsd:element name="translation">
<xsd:complexType mixed="true">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:any namespace="http://www.w3.org/1999/xhtml"
processContents="skip" />
<xsd:element ref="include" />
</xsd:choice>
<xsd:attribute name="language" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
<xsd:element name="include">
<xsd:complexType>
<xsd:attribute name="idref" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:schema>And here is a portion of my xml file:
<?xml version="1.0" encoding="UTF-8"?>
<lexicon xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.jeromedroz.org/etc/lexicon.xsd
./lexicon.xsd"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.jeromedroz.org/etc/lexicon.xsd"
name="lexicon">
<available-languages>
<language value="fr" default="true" />
<language value="en" />
</available-languages>
<term id="include-this">
<translation language="fr">inclure cela</translation>
<translation language="en">include this</translation>
</term>
<term id="home">
<html:a href="http://www.mysite.org">
<translation language="fr">accueil</translation>
<include idref="include-this" />
</html:a>
</term>
</lexicon>The idref attribute of the include tag is a reference to the id attribute of the term tag. The problem is the key and keyref definition in the xsd file: for example, if a term appears more than once (with the same id) the parser should notice it because the key is duplicated, but it doesn't. I've tried several places for the key and keyref definition in the xsd file but I get an error like KeyRefOutOfScope nearly all the time. Do anybody have a solution? -
Receiving Custom XML Document over AS2 (HTTPS) - Inbound Processing
Hi All,
Need help in Receiving Custom XML Document over AS2 (HTTPS) - Inbound Processing
External Trading Partner will be able to post the XML Documents to https://<b2bconsolehost>:<b2bconsoleport>/b2b/httpReceiver.
Here is the process flow:
1. External Trading Partner will be posting the XML Documents to https://<b2bconsolehost>:<b2bconsoleport>/b2b/httpReceiver
2. B2B, consumes the Custom XML validates as per the XSD and process it.
3. How to send the ACK back to External Trading Partner if it validates successfully and sent it to 'IP_IN_QUEUE'
4. How to send the ACK back to External Trading Partner if the validation fails after receiving the XML document.
5. Does the External Trading Partner require any certificates to post the XML Documents to https://<b2bconsolehost>:<b2bconsoleport>/b2b/httpReceiver (no need of encryption/decryption)?
6. How to enable the B2B server to accept the HTTPS messages from the Trading Partner (no need of encryption/decryption).
Please let me know. Thanks In Advance.
Regards,
AmirineniHi Nandu, Ramesh,
We have done the set-ups for transmitting a Custom XML Document over HTTP1.1 in B2B.
Our Business Case is as follows:
1. Read the Flat File using BPEL File Adapter
2. Transform the Message in BPEL and send it to B2B
2. Based on the set-ups in B2B, we need to post the XML message to the folliwng URL:-
http://databridge.buy.datastream.net:5555/invoke/dsImport/receiveXML
In the B2B Set-Ups, I have done the following:
Business Protocol name: Custom Document over Internet
Exchange Protocol: AS
Document Protocol: Custom
Transport Protocol: HTTP-1.1
Host name : http://databridge.buy.datastream.net
Port: 5555
I have also deployed the agreement as well as the configuration. The issue that I am currently facing is when I select the configuration in WSIL browser in JDeveloper, I am getting the following error:
"Unable to get schema information for target".
Hence I am not able to map the message in BPEL and send it to B2B.
Could you please let me know the possible causes and if I am missing anything in the set-ups in B2B.
As always, your help and guidance is highly appreciated.
Thanks,
Dibya -
Xml document validation using Schema
I want to validate XML Document using XML Schema...
does any body have an idea how to do it.
Every time i m running my java file by using different XML FILE AND XSD FILE in command line i m getting same error.
error is:
Exception in thread "main" org.xml.sax.SAXException: Error: URI=null Line=2: s4s-elt-schema-ns: The namespace of element 'catalog' must be from the schema name space.
at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1115)
at SAXLocalNameCount.main(SAXLocalNameCount.java:117)
Below is my java code with xml file and schema file.
plz get back to me as soon as possible it is urgent.
thanx
java File
import javax.xml.parsers.*;
import org.xml.sax.*;
import org.xml.sax.helpers.*;
import java.util.*;
import java.io.*;
public class SAXLocalNameCount extends DefaultHandler {
/** Constants used for JAXP 1.2 */
static final String JAXP_SCHEMA_LANGUAGE =
"http://java.sun.com/xml/jaxp/properties/schemaLanguage";
static final String W3C_XML_SCHEMA =
"http://www.w3.org/2001/XMLSchema";
static final String JAXP_SCHEMA_SOURCE =
"http://java.sun.com/xml/jaxp/properties/schemaSource";
/** A Hashtable with tag names as keys and Integers as values */
private Hashtable tags;
// Parser calls this once at the beginning of a document
public void startDocument() throws SAXException {
tags = new Hashtable();
// Parser calls this for each element in a document
public void startElement(String namespaceURI, String localName,
String qName, Attributes atts)
throws SAXException
String key = localName;
Object value = tags.get(key);
if (value == null) {
// Add a new entry
tags.put(key, new Integer(1));
} else {
// Get the current count and increment it
int count = ((Integer)value).intValue();
count++;
tags.put(key, new Integer(count));
System.out.println("TOTAL NUMBER OF TAG IN FILE = "+count);
// Parser calls this once after parsing a document
public void endDocument() throws SAXException {
Enumeration e = tags.keys();
while (e.hasMoreElements()) {
String tag = (String)e.nextElement();
int count = ((Integer)tags.get(tag)).intValue();
System.out.println("Local Name \"" + tag + "\" occurs " + count
+ " times");
static public void main(String[] args) throws Exception {
String filename = null;
String schemaSource = null;
// Parse arguments
schemaSource = args[0];
filename = args[1];
// Create a JAXP SAXParserFactory and configure it
SAXParserFactory spf = SAXParserFactory.newInstance();
// Set namespaceAware to true to get a parser that corresponds to
// the default SAX2 namespace feature setting. This is necessary
// because the default value from JAXP 1.0 was defined to be false.
//spf.setNamespaceAware(true);
// Validation part 1: set whether validation is on
spf.setValidating(true);
// Create a JAXP SAXParser
SAXParser saxParser = spf.newSAXParser();
System.out.println(" saxparser "+saxParser);
// Validation part 2a: set the schema language if necessary
if (true) {
try {
saxParser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
System.out.println(" saxparser ");
} catch (SAXNotRecognizedException x) {
// This can happen if the parser does not support JAXP 1.2
System.err.println(
"Error: JAXP SAXParser property not recognized: "
+ JAXP_SCHEMA_LANGUAGE);
System.err.println(
"Check to see if parser conforms to JAXP 1.2 spec.");
System.exit(1);
// Validation part 2b: Set the schema source, if any. See the JAXP
// 1.2 maintenance update specification for more complex usages of
// this feature.
if (schemaSource != null) {
saxParser.setProperty(JAXP_SCHEMA_SOURCE, new File(schemaSource));
System.out.println(" saxparser 123");
// Get the encapsulated SAX XMLReader
XMLReader xmlReader = saxParser.getXMLReader();
System.out.println(" XML READER "+xmlReader);
// Set the ContentHandler of the XMLReader
xmlReader.setContentHandler(new SAXLocalNameCount());
System.out.println(" XML READER 345 ");
// Set an ErrorHandler before parsing
xmlReader.setErrorHandler(new MyErrorHandler(System.err));
System.out.println(" XML READER 67878 ");
// Tell the XMLReader to parse the XML document
xmlReader.parse(filename);
System.out.println(" XML READER ");
// Error handler to report errors and warnings
private static class MyErrorHandler implements ErrorHandler {
/** Error handler output goes here */
private PrintStream out;
MyErrorHandler(PrintStream out) {
this.out = out;
* Returns a string describing parse exception details
private String getParseExceptionInfo(SAXParseException spe) {
String systemId = spe.getSystemId();
if (systemId == null) {
systemId = "null";
String info = "URI=" + systemId +
" Line=" + spe.getLineNumber() +
": " + spe.getMessage();
return info;
// The following methods are standard SAX ErrorHandler methods.
// See SAX documentation for more info.
public void warning(SAXParseException spe) throws SAXException {
out.println("Warning: " + getParseExceptionInfo(spe));
public void error(SAXParseException spe) throws SAXException {
String message = "Error: " + getParseExceptionInfo(spe);
throw new SAXException(message);
public void fatalError(SAXParseException spe) throws SAXException {
String message = "Fatal Error: " + getParseExceptionInfo(spe);
throw new SAXException(message);
xml file(books.xml)
<?xml version="1.0"?>
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
</book>
<book id="bk102">
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-12-16</publish_date>
<description>A former architect battles corporate zombies,
an evil sorceress, and her own childhood to become queen
of the world.</description>
</book>
<book id="bk103">
<author>Corets, Eva</author>
<title>Maeve Ascendant</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-11-17</publish_date>
<description>After the collapse of a nanotechnology
society in England, the young survivors lay the
foundation for a new society.</description>
</book>
<book id="bk104">
<author>Corets, Eva</author>
<title>Oberon's Legacy</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2001-03-10</publish_date>
<description>In post-apocalypse England, the mysterious
agent known only as Oberon helps to create a new life
for the inhabitants of London. Sequel to Maeve
Ascendant.</description>
</book>
<book id="bk105">
<author>Corets, Eva</author>
<title>The Sundered Grail</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2001-09-10</publish_date>
<description>The two daughters of Maeve, half-sisters,
battle one another for control of England. Sequel to
Oberon's Legacy.</description>
</book>
<book id="bk106">
<author>Randall, Cynthia</author>
<title>Lover Birds</title>
<genre>Romance</genre>
<price>4.95</price>
<publish_date>2000-09-02</publish_date>
<description>When Carla meets Paul at an ornithology
conference, tempers fly as feathers get ruffled.</description>
</book>
<book id="bk107">
<author>Thurman, Paula</author>
<title>Splish Splash</title>
<genre>Romance</genre>
<price>4.95</price>
<publish_date>2000-11-02</publish_date>
<description>A deep sea diver finds true love twenty
thousand leagues beneath the sea.</description>
</book>
<book id="bk108">
<author>Knorr, Stefan</author>
<title>Creepy Crawlies</title>
<genre>Horror</genre>
<price>4.95</price>
<publish_date>2000-12-06</publish_date>
<description>An anthology of horror stories about roaches,
centipedes, scorpions and other insects.</description>
</book>
<book id="bk109">
<author>Kress, Peter</author>
<title>Paradox Lost</title>
<genre>Science Fiction</genre>
<price>6.95</price>
<publish_date>2000-11-02</publish_date>
<description>After an inadvertant trip through a Heisenberg
Uncertainty Device, James Salway discovers the problems
of being quantum.</description>
</book>
<book id="bk110">
<author>O'Brien, Tim</author>
<title>Microsoft .NET: The Programming Bible</title>
<genre>Computer</genre>
<price>36.95</price>
<publish_date>2000-12-09</publish_date>
<description>Microsoft's .NET initiative is explored in
detail in this deep programmer's reference.</description>
</book>
<book id="bk111">
<author>O'Brien, Tim</author>
<title>MSXML3: A Comprehensive Guide</title>
<genre>Computer</genre>
<price>36.95</price>
<publish_date>2000-12-01</publish_date>
<description>The Microsoft MSXML3 parser is covered in
detail, with attention to XML DOM interfaces, XSLT processing,
SAX and more.</description>
</book>
<book id="bk112">
<author>Galos, Mike</author>
<title>Visual Studio 7: A Comprehensive Guide</title>
<genre>Computer</genre>
<price>49.95</price>
<publish_date>2001-04-16</publish_date>
<description>Microsoft Visual Studio 7 is explored in depth,
looking at how Visual Basic, Visual C++, C#, and ASP+ are
integrated into a comprehensive development
environment.</description>
</book>
</catalog>
(books.xsd)
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="catalog">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="book" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="author" type="xsd:string"/>
<xsd:element name="title" type="xsd:string"/>
<xsd:element name="genre" type="xsd:string"/>
<xsd:element name="price" type="xsd:float"/>
<xsd:element name="publish_date" type="xsd:date"/>
<xsd:element name="description" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>Add xmlns:xsi attribute to the root element <catalog>.
<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation='books.xsd'> -
Error Landed Cost - Customs rate not valid (SAP B1 9.0 PL10)
Hello experts,
We would like your advise on the following issue.
We are currently using SAP Business One 9.0 (PL10) and we are trying to add a Landed Cost document, but the following error occurs:
Customs rate not valid. [Landed Costs - Rows - Duty Rate]
The SAP Note: '1928862 - An Error occurs when adding Landed Costs', which describes the error, is listed in the References section of PL09 and PL10 upgrade. However, the error still occurs.
Any advise on how to solve this issue?
Kind Regards,
Vassilis KorolisHi,
Is it happening for same scenario has mentioned in SAP note? If yes, raise ticket to SAP support.
Thanks & Regards,
Nagarajan -
How to reference vendor master data in Document Validation?
Hi,
We would like to display a warning message as follows during AP invoices posting if the following details have been defined in the vendor master data.
a. u201CAlternate payee has been definedu201D
b. u201CPermitted payee has been definedu201D
c. u201CPartner bank has been definedu201D
May i know the best method to do this? If i use document validation, how can i reference these details sitting in the Vendor master data?Hi,
You can use custom validation program (Z*) by copying standard validation (RGGBR000) program.
Modify the validation program to check table vendor master data.
After that, you need to assign this custom validation program to GBLR application area in GCX2.
Thanks -
Validation rule cost element via Idoc
Hi all,
i am sitting on the following Problem:
we are creating master data via an external tool, called MDM. It is an Access based tool as far as i know.
These data's are send via Idoc into our SAP R/3 system. It works fine.
The only issue we have:
If you create cost elements, you have normally a validation with gives you a warning that e.g. this cost element already exist. Via our Idoc its just overwriting this already existing cost elements, also the history, all data's are nearly lost.
Do we have to customize special validation rules? Is it because of Idoc? why is the existing validation not be activated via Idoc?
I hope i have written down enough information, so that somebody can help me. Thanks
MichaelHi Christian,
I have set a breakpoint in validation rule. The step from Financial Accounting is processed.
Prerequisite
BKPF-BUKRS = 'FAI' AND BKPF-BLART = 'WA' AND
BKPF-AWTYP = 'MKPF' AND BSEG-HKONT IN TESTE_CL
Check
BSEG-AUFNR IN TESTE_OP
The validation rule check only the first item from accounting document. So, all postings on account 1103010008 are blocked.
Itm PK Account Account short text Order Amount
1 99 1103010008 STOCKS OF AUXILIARY 63,15-
2 81 5102040001 Maintenance and Repa 101541 63,15
I need to check the second item from accouting document.
Do you have any suggestion to solve my problem?
Thanks.
Osmar. -
Send Customer Payment document to external application.
Dear All,
I am working on one of our customer requirement to send Customer Payment data from SAP ECC 6.0 to their application using SAP PI 7.0
I have created a customer Invoice (in Transaction Code FB70) without any reference document .
Now I want to generate a Customer payment document on the top of Customer Invoice generated as mentioned above.
Can any one please suggest the following:
1) Can we generate Customer payment document in transaction FII0
2) What are the mandatory parameters to generate Customer payment document.
3) If I need to send this data to external application using IDOCs , so can i use Program RFFOEDI1 as suggested in other threads.
what are the parameters needs to given to run the program?
4) How to configure the our output type so whenever we generate a Customer payment document, an IDOC should be genarated.
Also please confirm if I can use IDOC PAYEXT with basic type PEXR2001 or should I go for some other IDOC.
Best Regards
Honey
Edited by: Honey Gyanani on Jun 29, 2009 7:19 AMI have posted the same Question in ERP Financials and got the answer.
Honey... -
Problem printing custom size document
I am trying to print a custom size document (4.4"x7.2") that I created in Microsoft Word. I have set the Page size in Word, tried to create a custom size page in my Printer, and am unable to select this paper size in the properties of my printer (using the control panel). I am at a loss at how to eliminate the "Paper Mismatch" error. Any assistance would be greatly appreciated. (I have two other size papers I need to generate documents for as well...4.4"x6.2" and 4.4"x8.2")
Thanks!kathyfh
Welcome to the HP Community Forum.
I doubt I will get any thanks for this; some days are just like that. Smiling.
While there are several instances where the Specification Sheet is actually in error and Windows does support Custom sizes for some printer models in a similar printer class, I do believe that in the case of THIS printer model, the specs are correct: Only Mac OS supports Custom paper sizes.
More simply said: You cannot get there from here.
You are likely stuck with the paper sizes supported by the printer as specified in that Spec sheet.
I could not find the necessary file Create Custom Paper Sizes in Windows 7, Windows 8, and Mac OS X for YOUR printer model that one would expect to see in the How-to Support pages if the "Custom" paper sizes are supported for Windows.
I could be wrong -- I have been wrong before. I do not mind being wrong if it means you get what you need.
If you had something even close to what is allowed, you might be able to select something from the list, adjust the paper in the printer and try to get away with it by adjusting the Printing Preferences.
Printing Preferences
Click the Kudos Thumbs-Up to say Thank You!
And...Click Accept as Solution when my Answer provides a Fix or Workaround!
I am pleased to provide assistance on behalf of HP. I do not work for HP.
Kind Regards,
Dragon-Fur -
Custom user name validation in subscription to event
Hello,
I am on R11.5.10.2 and trying to create fnd_users using FND_USER_PKG.CREATEUSER. But i am getting following error :
ORA - 20001: Custom user name validation in subscription to event oracle.apps.fnd.user.name.validate failed.
The above mention business event is enabled but their is no subscription attached to it.
Can any body faced the same issue ?
Thanks
AyazAlso send the count of invalid onjects in the DBNot sure how the count would help, but I believe the name of invalid objects would be more helpful.
-
User exit for Change the Tariff Number in Customs Declaration Document
Hi Guru,
Due the business requirement, user only maintain the Tariff Number in ECC, there is an solution when GTS creating the customs declaration document in GTS, there is an user exit calling the Function Module (Customized program) to get the Tariff Number from ECC and then update the Tariff number in the item level automatically.
Do you know if there is user exit or BADI can update the "Tariff Number" in the item level of Customs Declaration Document in GTS?
Thanks,Hi,
I would not do it in that manner, first because of performance reasons and 2nd, GTS needs to have the Data in the system and for certain procedures (for example swiss customs you will have to manipulate them in GTS). Furthermore we tried to do this for dummy numbers and then conclusion is that it only works with a Programm modification (at least for CH customs) becasue the system needs to retreive more than just the Tarif number.
Yet if ECC has to be your master for Numbering (which I dont recommend by the way), but if there is really no other way.
Then create a batch job that transfers the ECCN number to GTS (there is a standard functionnality to do so), and then do a batch job in GTS that retreives these numbers.
Regards,
Marc -
Hi All,
We are planning to send Custom XML Document over HTTP(AS2) to the Remote Trading Partner. The XML Document needs to be posted to a particular URL in the Remote Trading Partner Site.Here is the process flow:
1. The input application format file having the messages will be transformed to an XML message in BPEL.
2. Then as per the set-ups done in B2B, this particular XML message needs to be posted to a URL.
I went through the B2B User's Guide but could not find any documentation on how to set up Custom XML Document over HTTP(AS2).
Could you please share the documents/technical notes or link which I can refer to do the set-ups in B2B.
Please let me know. Thanks In Advance.
Regards,
DIbyaHi Nandu, Ramesh,
We have done the set-ups for transmitting a Custom XML Document over HTTP1.1 in B2B.
Our Business Case is as follows:
1. Read the Flat File using BPEL File Adapter
2. Transform the Message in BPEL and send it to B2B
2. Based on the set-ups in B2B, we need to post the XML message to the folliwng URL:-
http://databridge.buy.datastream.net:5555/invoke/dsImport/receiveXML
In the B2B Set-Ups, I have done the following:
Business Protocol name: Custom Document over Internet
Exchange Protocol: AS
Document Protocol: Custom
Transport Protocol: HTTP-1.1
Host name : http://databridge.buy.datastream.net
Port: 5555
I have also deployed the agreement as well as the configuration. The issue that I am currently facing is when I select the configuration in WSIL browser in JDeveloper, I am getting the following error:
"Unable to get schema information for target".
Hence I am not able to map the message in BPEL and send it to B2B.
Could you please let me know the possible causes and if I am missing anything in the set-ups in B2B.
As always, your help and guidance is highly appreciated.
Thanks,
Dibya
Maybe you are looking for
-
Hdmi cable will not work on ipad1
Have ipad1 with apple hdmi connector & 25' hdmi cable iOS on ipad1 is 5.1.1 will not connect Anyone else have this issue?
-
6500 Slide screensaver no coming on
Hi all, I have my 6500 Slide connected via Bluetooth to my work PC and my home PC, for syncing contacts and to-do items. This works fine. When I first hooked it up to the work PC, the sync worked with no problems, but the screensaver stopped working
-
InstanceValueIf without a unique identifier in OPM 10.1
Hi, I need to get an instance value from a child instance when the condition I use can have the same conclusion in few instances as there is no data I could use to make the conclusion unique. The issue is that InstanceValueIf requires to have a condi
-
Setting track for a captivate course
Does anyone know if you can set up "tracks" for a captivate course in the LMS. I have a course with a lesson that is only applicable to certain group of learners and we dont want the rest of the company to view that information. Our LMS does have the
-
Basically, i was on my ipod playing a game and i tried to zoom out on the game and it wouldnt let me, then i got a notification on my ipod from facebook and when i tried to press it, it wouldnt let me! so i locked the screen, and when i try to unlock