XML Validation with multiple XSD files (referenced)

Hello,
I know that XML validation with version 7.1 is possible now. However I was provided with a set of XSD files that have references to each other and need to be placed in a hierachical file system order so that references can be resolved.
An element <xsl:include schemaLocation="../../baseSchemas/baseSchema.xsd" /> is used for example. How can I handle that for XSD validation in PI? Can I create the same folder structure or do I need to put all XSD files in one directory and change the import manually?
But most important question: Is it possible it all to use more than one XSD for schema validation?

Dear Florian,
I had encountered such case in a project.
I was given 3 files. One main file and 2 others called Schema1.xsd and Schema2.xsd.
This happens because your data type is not in single namespace, but is being referred across namespaces and software components.
I am assuming that you have read the How to Guide for XML validations on PI 7.1
Best way to do this quickly is as follows.
1. Enable XML validation at adapter engine in the sender agreement.
2. Post a message using HTTP post. (http://sappihttpclient.codeplex.com)
3. Check communication channel in runtime workbench. There will be an error saying which is missing at what path.
4. Create the path mentioned and place the file at that path.
5. Repeat steps 2,3,4 for all the files.
When you are done with this, you will get a proper validation error in case XML file is not correct. And remember to generate XSD from message type and not data type.
Regards,
Vikas
Edited by: Vikas Aggarwal on Sep 2, 2009 8:45 PM
Edited by: Vikas Aggarwal on Sep 2, 2009 8:48 PM

Similar Messages

  • XML Validation with External XSD

    Hi
    I have a xml file having DTD declaration, but my requirment is to validate this xml file with External XSD not with DTD which is declared inside the file.
    on executing java code below it is looking for DTD. how to supress validating against dtd.
    SAXParserFactory factory = SAXParserFactory.newInstance();
                   factory.setValidating(false);
                   factory.setNamespaceAware(true);
                   SchemaFactory schemaFactory =
                       SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
                   factory.setSchema(schemaFactory.newSchema(
                       new Source[] {new StreamSource("C:\\vittal\\Project\\received\\development-1\\da_xsd\\daAuthoring.xsd")}));
                   SAXParser parser = factory.newSAXParser();
                   XMLReader reader = parser.getXMLReader();
                   reader.setErrorHandler(new LogErrorHandler());
                   reader.parse(new InputSource("C:\\vittal\\Project\\received\\A-ADD\\DAContentExamples_2\\SampleGuidance_1.xml"));error i am getting is License file saxon-license.lic not found. Running in non-schema-aware mode
    java.io.FileNotFoundException: C:\vittal\Project\received\A-ADD\DAContentExamples_2\daAuthoring.dtd (The system cannot find the file specified)

    Hi
    I have a xml file having DTD declaration, but my requirment is to validate this xml file with External XSD not with DTD which is declared inside the file.
    on executing java code below it is looking for DTD. how to supress validating against dtd.
    SAXParserFactory factory = SAXParserFactory.newInstance();
                   factory.setValidating(false);
                   factory.setNamespaceAware(true);
                   SchemaFactory schemaFactory =
                       SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
                   factory.setSchema(schemaFactory.newSchema(
                       new Source[] {new StreamSource("C:\\vittal\\Project\\received\\development-1\\da_xsd\\daAuthoring.xsd")}));
                   SAXParser parser = factory.newSAXParser();
                   XMLReader reader = parser.getXMLReader();
                   reader.setErrorHandler(new LogErrorHandler());
                   reader.parse(new InputSource("C:\\vittal\\Project\\received\\A-ADD\\DAContentExamples_2\\SampleGuidance_1.xml"));error i am getting is License file saxon-license.lic not found. Running in non-schema-aware mode
    java.io.FileNotFoundException: C:\vittal\Project\received\A-ADD\DAContentExamples_2\daAuthoring.dtd (The system cannot find the file specified)

  • XML validation with more XSD

    Hi All!
    I'd have to create a java application which can validate xml files, but I have got more than one xsd to the xml. Somebody colud help me how could I create this program which use more xsd?
    Thanks!
    Atesy

    Validation isn't really that hard. Here's an old example that ran under Java 1.4. Could stand some updating for 5.0 or 6, and uses an external class to get the input stream, but it should illustrate some of the basic techniques.
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import org.xml.sax.helpers.DefaultHandler;
    import com.xxx.util.StringUtils;
    * Validates XML documents. It is the caller&rsquo;s responsibility to handle any exceptions
    * thrown during validation.
    * @.future After moving to Java 5.0, use JAXP 1.3&rsquo;s <code>SchemaFactory</code>
    * mechanism, which is more efficient.
    public class Validator extends DefaultHandler
    private static final String BUILDER_FACTORY_PROPERTY  = "javax.xml.parsers.DocumentBuilderFactory"              ;
    private static final String BUILDER_FACTORY_VALUE     = "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"     ;
    private static final String SCHEMA_LANGUAGE_ATTRIBUTE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
    private static final String SCHEMA_LANGUAGE_VALUE     = "http://www.w3.org/2001/XMLSchema"                      ;
    private static final String SCHEMA_SOURCE_ATTRIBUTE   = "http://java.sun.com/xml/jaxp/properties/schemaSource"  ;
    private final DocumentBuilder builder;
    public Validator(final String schemaLocation) throws ParserConfigurationException
       System.setProperty(BUILDER_FACTORY_PROPERTY, BUILDER_FACTORY_VALUE)    ;
       final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance()  ;
       factory.setNamespaceAware(true)                                        ;
       factory.setValidating(true)                                            ;
       factory.setAttribute(SCHEMA_LANGUAGE_ATTRIBUTE, SCHEMA_LANGUAGE_VALUE) ;
       factory.setAttribute(SCHEMA_SOURCE_ATTRIBUTE , schemaLocation)         ;
       builder = factory.newDocumentBuilder()                                 ;
       builder.setErrorHandler(this)                                          ;
    * Validates an XML document against the schema passed to the constructor.
    * @param xml The document to validate.
    * @throws IOException If an I/O error occurs.
    * @throws SAXException If a parsing error occurs.
    public void check(final File xml) throws IOException, SAXException
       check(new FileInputStream(xml));
    private void check(final InputStream stream) throws IOException, SAXException
       final InputSource source = new InputSource(stream);
       builder.parse(source);
    * Validates an XML document against the schema passed to the constructor.
    * @param xml The document to validate.
    * @throws IOException If an I/O error occurs.
    * @throws SAXException If a parsing error occurs.
    public void check(final String xml) throws IOException, SAXException
       check(StringUtils.getInputStream(xml));
    public void error(final SAXParseException exception) throws SAXException
       throw exception;
    public void fatalError(final SAXParseException exception) throws SAXException
       throw exception;
    public void warning(final SAXParseException exception) throws SAXException
       throw exception;
    }

  • Rules Problem with multiple XSD

    Hi,
    I've done a jdev project for SOA Suite 11g including only one Business Rules which could be call by a Webservice.
    When I used 2 differents XSD to define 1 input fact and 1 output fact, the rule engine failed with an UNEXPECTED element Error
    <fault>
    <faultType>0</faultType>
    <operationErroredFault>
    <part name="payload">
    <errorInfo>
    <errorMessage>unexpected element (uri:"http://www.arvato.fr/formatPivot", local:"CUSTOMER"). Expected elements are <{http://www.arvato.fr/formatPivot}ADDRESS>,<{http://www.arvato.fr/formatPivot}DedoublonnageRule>,<{http://www.arvato.fr/formatPivot}StatusRule></errorMessage>
    </errorInfo>
    </part>
    </operationErroredFault>
    </fault>
    When I use only one XSD file in my facts fou my input and outpout values. It runs Well.
    Here are the facts definition with Multiple XSD FIle :
    http://lh5.ggpht.com/_noQvj60LDl4/S4-J8DcFEkI/AAAAAAAAAKU/fAtlSMgFS_8/separatedSchemas.png
    Here are the facts definition with Single XSD FIle :
    http://lh6.ggpht.com/_noQvj60LDl4/S4-J78qnj0I/AAAAAAAAAKQ/U1JNnaJyK50/includedSchema.png
    Could you please answer me how to use multiple xsd file in facts ?
    Regards,
    Jerome.

    Hi,
    Does anybody have any idea ?
    Regards,
    Jerome

  • How to create java classes when multiple xsd files with same root element

    Hi,
    I got below error
    12/08/09 16:26:38 BST: [ERROR] Error while parsing schema(s).Location []. 'resultClass' is already defined
    12/08/09 16:26:38 BST: [ERROR] Error while parsing schema(s).Location []. (related to above error) the first definition appears here
    12/08/09 16:26:38 BST: Build errors for viafrance; org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the plugin manager executing goal 'org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.7.1:generate': Mojo execution failed.
    I tried genarate java classes from multiple xsd files, but getting above error, here in .xsd file i have the <xe: element="resultClass"> in all .xsd files.
    So I removed all .xsd files accept one, now genarated java classes correctly. but i want to genarte the java classes with diffrent names with out changing .xsd
    Can you please tell me any one how to resolve this one......
    regards
    prasad.nadendla

    Gregory:
    If you want to upload several Java classes in one script the solution is .sql file, for example:
    set define ?
    create or replace and compile java source named "my.Sleep" as
    package my;
    import java.lang.Thread;
    public class Sleep {
    public static void main(String []args) throws java.lang.InterruptedException {
    if (args != null && args.length>0) {
    int s = Integer.parseInt(args[0]);
    Thread.sleep(s*1000);
    } else
    Thread.sleep(1000);
    create or replace and compile java source named "my.App" as
    package my;
    public class App {
    public static void main(String []args) throws java.lang.InterruptedException {
    System.out.println(args[0]);
    exit
    Then the .sql file can be parsed using the SQLPlus, JDeveloper or SQLDeveloper tools.
    HTH, Marcelo.

  • XML validating with XSD

    Please clarify the following
    1) To validate a XML output with a XSD is it necessary to register the xsd in the database?.
    2) I tried running the below give command to register the .xsd file. It errored out with the below message. Do we need to some additional installation for having dbms_xmlschema in oracle database or am I missing something. My ver of oracle is 9.2.0.6.0.
    ERROR at line 2:
    ORA-06550: line 2, column 1:
    PLS-00201: identifier 'DBMS_XMLSCHEMA.REGISTERSCHEMA' must be declared
    BEGIN
    DBMS_XMLSchema.registerSchema(
    schemaurl=>'http://ifsddev.na.abc.com/home/vick/105564/batchuserimport.xsd',
    schemadoc=>sys.UriFactory.getUri('/home/vick/105564/batchuserimport.xsd'));
    END;

    1) You could validate XML files against an XSD by using standard Java, PL/SQL, etc. functionality. Just to validate XML you do not need to register the schema in XDB. See e.g. http://www.oracle.com/technology/pub/articles/vohra_xmlschema.html
    2) Also see: DBMS_XMLSCHEMA.REGISTERSCHEMA' must be declared to know whether XML DB has been installed/configured.
    Regards, Ronald

  • Validating with multiple schemas

    I am setting the schama attribute as follow:
    String schemaSource = "C:\\Documents and Settings\\ayache\\My Documents\\C5 XML\\schema\\searhRequest.xsd";
                   String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
                   builderFactory.setAttribute(JAXP_SCHEMA_SOURCE, new File(schemaSource));searchRequest.xsd contains include statement: it referes to another schema. When i try to validate the xml document using the scheam above error is thrown stating that the elements that are defined in the second schema(BookingProfile.xsd) are not recognised or can't be resolved.
    Is there a way to set multiple schemas?
    Your help is much appreciated.

    I figured out my problem in case anyone else is having trouble..
    In the xml document that you need to refer to:
    xmlns:xsd="http://www.w3.org/2000/10/XMLSchema-instance that is the namespace
    supported by xerces 1.3.1.
    Whew!
    "Karen Schaper" <[email protected]> wrote:
    >
    Has anyone been successful at validating xml with a Schema running weblogic
    6.1
    sp2?
    Here is a snippet of code...
    SAXParserFactory objFactory = SAXParserFactory.newInstance();
    objFactory.setValidating("true");
    objFactory.setNamespaceAware("true");
    objFactory.setFeature("http://apache.org/xml/features/validation/schema",
    "true");
    objXMLInputParser.parse(new InputSource(new StringReader(XMLDocument)),
    A_HANDLER);
    When my xml code runs through the parser I get an error for each element
    saying
    the element type is not declared in the dtd or schema.
    Since weblogic 6.1 runs with 1.3.1 Xerces parser. Does it support xml
    validation
    with a Schema. From what I've read it seems that it does.
    Any help or insight would be appreciated.
    Thanks
    Karen

  • Creating IPA file with Multiple SWF files using ADT

    Iam successfully able to create ipa files using the ADT package but my next requirement is to create an IPA file with multiple swf files.I think it might be easy if your SWF files are regular the tough part is my swf file has lot of action script in it so the only option is to through the command prompt and using the ADT package of Adobe AIR.So now i have 10 SWF files like this and iam creating ipa file for each swf seperatly but now I want to put all of the swf files into one ipa file.Please let me know if i was not clear in my description

    I think you are trying to explain how to load two swf's one with action
    script and loading an other swf file which should be non action script.If
    you read my requirement carefully.I have all the same type of swf's and
    these swf are automatically created as a form of output for xcelsius dash
    board software.Iam capable of creating individialu ipa files from these swf
    files.So when I try to combine the same kind of swf files the first error
    its giving is the file name which I have used in the xml.in the main file
    name for the swf file its not considering the two swf file name in the
    initial window.so the adt package in the command line is not understanding
    the file name from the xml and the command prompt and giving error this swf
    file does not exist.So please consider how to combine two swf files with AS3
    into one ipa file.These swf files are not editable,Let me know if you find
    any idea to achieve this

  • Import Multiple XSD Files

    Is it not possible to import multiple xsd files. If a single file is used there is no problem but when the second import statement is added, it will not compile.
    It complains that it cannot find one of the element types. Removing the second import it compiles fine.
    I also tried it using seperate schema tags for each import.
    <types>
      <schema xmlns="http://www.w3.org/2001/XMLSchema">
       <import namespace="http://TargetNamespace.com/ftpadapter"
               schemaLocation="delimited_2.txt"/>
       <import namespace="http://xmlns.oracle.com/FTP_Test"
               schemaLocation="FTP_Test.xsd"/>
      </schema>
    </types>

    It is possible to add multiple XSD's in WSDL.
    1. Did u add different namespace alias's for these two in <definitions> section ??
    2.How you are referring the element which it can't find in the wsdl ?
    Try this to identify the issue
    "remove the first xsd and use the second one alone. "
    If this works then it eliminates that there is an issue with xsd.
    Thanks,
    Satish
    http://soadiscovery.blogspot.com

  • How to create list items with multiple attachment files using rest api javascript

    In one of user form I am using javascript rest api to create a list item with multiple attachment files. So far I am able to create list item and once created uploading an attachment file. But this is two step process first create an item and then upload
    a file.
    It create an additional version of the item which is not desired. Also I am not able find a way to attach multiple files in a go. Following is the code I am using.
    createitem.executeAsync({
                    url: "/_api/web/lists/GetByTitle('UserForm')/items(1)/AttachmentFiles/add(FileName='" + aFile.name + "')",
                    method: "POST",
                    contentType: "application/json;odata=verbose",
                    headers: {
                        "Accept": "application/json;odata=verbose",
                        "X-RequestDigest": $("#__REQUESTDIGEST").val()
                    binaryStringRequestBody: true,
                    body: fileContent,
                    success: fnsuccess,
                    error: fnerror
    So somehow I need to combine item attributes along with attachment files in body: param. I visited https://msdn.microsoft.com/en-us/library/office/dn531433.aspx#bk_ListItem but no success.
    Appreciate any help.

    Thanks Mahesh for the reply and post you share it was useful.
    But this does not solve the core of the issue. You are uploading attachments after creation of item and multiple files are being attached in loop. This is kind of iterative update to an existing item with attachments. This will end up creating multiple versions. 
    What I am trying to achieve is to create an item along with multiple attachments in a go. No item updates further to attach a file.
    Please suggest how this can be done in one go. SharePoint does it when one creates an item with multiple attachment.
    Thanks for your reply.

  • Howto deal with multiple source files having the same filename...?

    Ahoi again.
    I'm currently trying to make a package for the recent version of subversive for Eclipse Ganymede and I'm almost finished.
    Some time ago the svn.connector components have been split from the official subversive distribution and have to be packed/packaged extra. And here is where my problem arises.
    The svn.connector consists (among other things) of two files which are named the same:
    http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/features/org.polarion.eclipse.team.svn.connector_2.0.3.I20080814-1500.jar
    http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/plugins/org.polarion.eclipse.team.svn.connector_2.0.3.I20080814-1500.jar
    At the moment makepkg downloads the first one, looks at its cache, and thinks that it already has the second file, too, because it has the same name. As a result, I can neither fetch both files nor use both of them in the build()-function...
    Are there currently any mechanisms in makepkg to deal with multiple source files having the same name?
    The only solution I see at the moment would be to only include the first file in the source array, install it in the build()-function and then manually download the second one via wget and install it after that (AKA Quick & Dirty).
    But of course I would prefer a nicer solution to this problem if possible. ^^
    TIA!
    G_Syme

    Allan wrote:I think you should file a bug report asking for a way to deal with this (but I'm not sure how to fix this at the moment...)
    OK, I've filed a bug report and have also included a suggestion how to solve this problem.

  • How to create a blu-ray disc with multiple source files

    Hello,
    How is it possible to create a blu-ray disc, AVCHD recordable DVD with multiple source files from Final Cut Pro 10. Is it possible to create a menu with several chapters corresponding to the sequences (source files)?
    Thank you in advance for your support.

    Assume you're talking about using the Create Blu-Ray batch template. It's not possible to do with multiple source filles. But if I understand your objectives, you could pretty much get what you think want – discrete movie segments on a single disk with navigation.
    The way I'd approach it is by making multiple projects in FCP and then copying the finished versions into a new project, separated by gaps. (You could also use compound clips but I'm not a fan except for very short sequences, which is why I'm suggesting the copy route.) Then export and bring into Compressor.
    In Compressor mark your chapters at the gaps between your individual sequences. Then choose the AVCHD option in job actions.
    Bear in mind that you'll have to keep the recording time under roughly 30-35 minutes @a5 Mbts/sec
    Good luck.
    Russ

  • VM installation with multiple .iso files

    Hello All:
    I have a windows image which spread across 3 iso files. So I started to install the VM from the first iso files, then it got to a point where it ask me for the 2nd iso file.
    This is where I am stuck. Does anyone successfully install a VM with multiple iso files?
    What is the correct procedure to do this installation?
    thanks,
    Peter
    Edited by: user3229804 on Jun 21, 2011 11:45 AM

    First thing, have you already imported (into VM Manager) the other CD/DVD's into separate .iso files?
    Then during installation, from open VNC Console window, make sure that you resize the window so that the lower portion is visible. There is a drop down button that will let you select a different .iso file, and a button next to it that says something like "Change Disk". This effectively lats you swap the DVD for the installation process to continue.
    Screen shots would be helpful here, but the key is resizing the VNC Console window, because duringmy install, the default window size cropped these buttons out.
    Hope this helps.

  • XML Validation with XSD in java mapping

    Hi experts,
    I have created an interface to send differents messages between bussines system, the bussiness system receiver is put in the message, to get this value I have a configuration file indicating the path of this field for each message type. In a java mapping I transform the message sent in this structure:
    <document>
    <message>HERE THE MESSAGE AS STRING</message>
    <parameters>
    <sender>HERE SENDER BUSSINESS SYSTEM</sender>
    <receiver>HERE RECEIVER BUSSINESS SYSTEM</receiver>
    </parameters>
    </document>
    the messaging interface works fine, but now I have to validate the XML vs XSD. I need doing in a java mapping because the messaging interface send the message and a email to sender in error case.
    To do this validation I have implemented two java mappings that works fine in my local, the first way is with class Validator of java 5, but my system PI 7.1 return an error with this class. The second way is with SAX parse:
    String schema = "XXXXXxsd";
    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
    docBuilderFactory.setNamespaceAware(true);
    docBuilderFactory.setValidating(true);
    docBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage","http://www.w3.org/2001/XMLSchema");
    InputStream is = this.getClass().getClassLoader().getResourceAsStream(schema);
    docBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource",is);
    in my local works fine but in PI always return OK never fail.
    For this moment the schema is hardcoded to do proofs, in the future will be loaded from my configuration file.
    Any idea?
    Thanks in advance
    Jose

    hi Jose,
    PI 7.1 has a built in feature available called XML vaidations ..
    your source xml can be validated against a XSD placed at a specific location on the PI server..
    validation can be performed at adapter/integration engine
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d06dff94-9913-2b10-6f82-9717d9f83df1?quicklink=index&overridelayout=true

  • XSD validation with multiple namespaces

    Hi All,
    I'm trying to validate some XML using an XSD that contains multiple namespace schema descriptions, as such, the main XSD file must import an XSD for each namespace.
    The difficulty is that I cannot seem to find a way (in Oracle) to run a XSD validation using this (multi-XSD file) method.
    Has anyone out there tackled a similar problem?
    Cheers,
    Ben

    check out the class
    CL_XML_SCHEMA
    Regards
    Raja

Maybe you are looking for

  • RFC destination  ((((URGENT PLZZZZZZZZ)

    Hi Sap Gurus I am executing  bd82 by giving my  other client  logical system  that means mm_re There It is giving one message port could to be created   RFC destination MM_se( this is RFC destination name) is not specified for mm_se( logical system n

  • Only two computers authorized but ACC songs won't copy to iPod.

    Today I purchased some new music from iTunes. Once I was finished downloading iTunes informed me that I might want to upgrade the software on my iPod. I did. Then when it went to sync everything it came up with the following message. "Some of the ite

  • Poltergeist: iTunes 7.0.2 opening by itself

    I updated to iTunes 7.0.2 yesterday and now iTunes opens up by itself several mintues after I quit. This has been happening over and over again all day! I've checked on various settings, but can't figure it out. Does anyone else have this problem or

  • How to change logo in Oracle Apps Homepage?

    Hi All, Just of curiosity and branding I want to put my company's logo instead of Oracle in Apps Homepage. Can anyone help me on this? Thanks, Anchorage

  • Configuring ADF Graph Component

    Hi all, Can you help me to find any document that explains how to configure a graph component in a ADF Swing application? I've seen a lot of documents about DVT Graph component but they do not apply to Swing. Is there any wizard that can be used in t