XML XSLT Maping Problem in XI

Hi,
I'm actually doing some tests with the possibility to invoke a ABAP-Mapping (ABAP-Class).
So my scenario is quite simple:
I have a import xml where I want to substitute exactly one value (database select).
Now my problem is that the xml comes in with a namespace at the toplevel element (I wrote the complete source string to the trace in my execute function) called "ns0".
So I stored the output of the trace to a local file for testing and developing a XSLT-Mapping.
In debugging mode I see that the command:
<xsl:for-each select="ns0:BAPI_SALESORDER_CREATEFROMDAT2/ORDER_PARTNERS">
doesn't work as (I) expected (want to loop at the partners) on this content:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:BAPI_SALESORDER_CREATEFROMDAT2 xmlns:ns0="urn:sap-com:document:sap:rfc:functions">
<ORDER_HEADER_IN>
<DOC_TYPE>TA</DOC_TYPE>
<SALES_ORG>1000</SALES_ORG>
<DISTR_CHAN>10</DISTR_CHAN>
<DIVISION>00</DIVISION>
<PURCH_NO_C>654</PURCH_NO_C>
</ORDER_HEADER_IN><ORDER_ITEMS_IN>
<item>
<PO_ITM_NO>10</PO_ITM_NO>
<MATERIAL>100-100</MATERIAL>
<TARGET_QTY>100</TARGET_QTY>
<T_UNIT_ISO>PCE</T_UNIT_ISO>
</item>
<item><PO_ITM_NO>20</PO_ITM_NO>
<MATERIAL>P-100</MATERIAL>
<TARGET_QTY>100</TARGET_QTY>
<T_UNIT_ISO>PCE</T_UNIT_ISO>
</item>
</ORDER_ITEMS_IN>
<ORDER_PARTNERS>
<item>
<PARTN_ROLE>AG</PARTN_ROLE>
<PARTN_NUMB>0000001000</PARTN_NUMB>
</item>
<item>
<PARTN_ROLE>WE</PARTN_ROLE>
<PARTN_NUMB>0000001000</PARTN_NUMB>
</item>
</ORDER_PARTNERS>
</ns0:BAPI_SALESORDER_CREATEFROMDAT2>
Anyone an idea?
Thnx
Olli

Hi Olli,
Did you declare the namespace in the XSLT itself?
Did your write something like?
<xsl:stylesheet
  exclude-result-prefixes="xsl ns0"
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:ns0="urn:sap-com:document:sap:rfc:functions">
Actually, the prefix is something you can freely choose.  It is not necessary to use the same prefix as in the source document.  You could just as well use the prefix "x" in your XSLT and write:
<xsl:stylesheet ...
  xmlns:x="urn:sap-com:document:sap:rfc:functions">
  <xsl:for-each select="x:BAPI_SALESORDER_CREATEFROMDAT2/ORDER_PARTNERS">
Kind regards, Guy Crets

Similar Messages

  • Transforming XML/XSLT : CDATA problem

    Hi!
    I have a problem transforming xml with XSLT using the API javax.xml.
    The result is correct until I have a CDATA section in my xml document.
    The transforming process encodes all the & < > (special characters) it finds in.
    This occurs problem for the follow of my treatement because the content of my CDATA is already encoded.
    For example, this xml code :
    <?xml version='1.0' encoding="ISO-8859-1" ?>
    <article>
    <article-contenu><![CDATA[Accent : &eacute; Signe : &lt;]]></article-contenu>
    </article>
    produces in my output :
    Accent : &amp;eacute; Signe : &amp;lt;
    This is my java code :
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Source xmlSource = new StreamSource(readerXml);
    Source xslSource = new StreamSource( fileXsl );
    // Generate the transformer.
    Transformer transformer = tFactory.newTransformer(xslSource);
    // Perform the transformation, sending the output to the response.
    transformer.transform(xmlSource, new javax.xml.transform.stream.StreamResult(sw));
    How can I tell the transformer not to do that?
    Thanks for your answers!

    I am having a similar problem. I have enclosed my text data in my xml file like this:
    <![CDATA[<b>Hello World!</b>]]>
    My select statement in my XSLT sheet is as follows:
    <xsl:value-of select="." disable-output-escaping="yes"/>
    I have tried setting xsl:output to text, to html, and to xml. The <, >, and & get converted to xhtml entities.
    Where should I begin to troubleshoot? If the Xalan xslt jars? My stylesheet. My xml doc? Java code?
    Any feedback welcome.

  • Xslt transform problem on Sun AS 8PE

    Hi,
    I have following xslt:
    <xsl:call-template name="CustomerFilter">
    <xsl:with-param name="custFilterPath" select="CustomerFilter"/>
    </xsl:call-template>
    <xsl:template name="CustomerFilter">
         <xsl:param name="custFilterPath"/>
         <xsl:text>Customer filter: </xsl:text>
         <strong>
              <xsl:value-of select="$custFilterPath/Type/text()"/> - <xsl:value-of select="$custFilterPath/Name/text()"/>
         </strong>
    </xsl:template>
    I have following xml :
    <CustomerFilter id="0" idDb="0">
    <Name>All</Name>
    <Type>All</Type>
    </CustomerFilter>
    I perform a server xml-xslt tranform to html using xalan 2.5.2 on tomcat5.0.x server with following code without any errors:
    TransformerFactory tf = TransformerFactory.newInstance();
    tf.setURIResolver(new ServerURIResolver(server_url));
    Transformer t = tf.newTransformer(new StreamSource(stylesheet));
    t.setOutputProperty(OutputKeys.INDENT, indenting);
    t.setOutputProperty(OutputKeys.ENCODING, encoding);
    t.setParameter("server_url", server_url);
    t.transform(new DOMSource(response_doc), new StreamResult(response_stream));
    But when I deployed the code on Sun App Server Update1 I get following error:
    [#|2004-10-25T11:54:48.757+0200|SEVERE|sun-appserver-pe8.0.0_01|javax.enterp
    rise.system.container.web|_ThreadID=13;|StandardWrapperValve[xmlgate]:
    Servlet.service() for servlet xmlgate threw exception
    javax.xml.transform.TransformerException: java.lang.RuntimeException:
    Invalid conversion from 'reference' to 'java.lang.String'.
    at
    org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:6
    44)
    at
    org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:3
    17)
    at
    the last line of sample code
    This code ran without any problems on Sun AS 7 (with Xalan 2.3.1_01).
    I don't know why it's not working. Can anybody help me?
    Thank you,
    Miro

    Actually Xalan version shipped with AS 8.0 is Xalan 2.5.2 + bugfixes. So it is possible that slightly different version might have gone into Tomcat but i am not sure here.
    So it would be good to know, how are you making sure that the same Xalan version is used with AS 8.0 or Tomcat ?
    Best Regards

  • Java Translets XML/XSLT Transformation

    Translets "are precompiled XSL documents that are optimized and converted into simple Java classes. When you compile your application Java files, you compile your XSL files into Java class files. During runtime, you can load translets like any regular Java class and perform XSL transformations over and over again.
    The syntax checking and parsing of XSL documents are done when the XSL files are compiled. The transformation therefore takes only as long as the compiled code takes to execute, which improves performance multiple folds.
    The downside to using XSL is that "it can take a considerable amount of time and reduce performance. The time needed to parse XML and XSL documents is directly proportional to the size of the documents. Each transformation requires the XML and XSL documents to be loaded, syntax checked, and parsed." I recommends using translets for the following reasons.
    I had written an application (<a href="http://www.simplygites.com" title="www.simplygites.com">SimplyGites</a>) using standard XSL / XML transformation and experienced some very slow server-side transformation on the very complex screens with large amounts of xml. Timings showed these problem screens took 2-3 seconds to transform, which was totally unacceptable non-functional requirements.
    I considered rewriting these screens as JSP or PHP, then I discovered Translets. And wow what a discovery the timings for these pages now compiled as Translets(java classes) are amazing in comparison to the original timings ? I now have them transforming in 500ms (all now under 1 second).
    I would recommend anyone using XSL/XML transformation to use Translets, these have now been running tried and tested on the <a href="http://www.simplygites.com" title="www.simplygites.com">SimplyGites</a> for the past 6months.
    Technolgies used:
    Weblogic 8.1 SP5
    Java 1.4.2
    Required Jars
    xsltc.jar
    runtime.jar
    BCEL.jar
    JLex.jar
    java_cup.jar
    regexp.jar
    xml-dtm.jar
    For more information see http://xml.apache.org/xalan-j/xsltc_usage.html
    I hope this helps anyone that has XML/XSLT performance issues.
    Mark
    MB Computer Ltd
    www.simplygites.com

    Thanks for your help.
    The problem was that my firewall was blocking my server.

  • Turning XML/XSLT files into a working Web Template

    I've scoured these and other forums for this small piece of information, so I apologize if it's been answered already, but I can't find it.
    I understand that the web templates in Lightroom are done in XML/XSLT, with the XML file named galleryMaker.xml and the XSLT file named transformer.xslt. However, I cannot figure out how to get these files to show up as a template in Lightroom.
    I am on a Windows XP machine, and all the templates show up in Application Data/Lightroom/Web Templates, but they are all of the type *.lrtemplate. Is there a way to convert the XML/XSLT set of files into an lrtemplate file? Or is there something else I'm supposed to do?

    Splatt42 wrote:
    I have an executable binary program (that runs just fine on it's own) that I needed to turn into a service (call it "foo"). I did so using the .xml file below, and it does indeed start up at boot, runs in the background,When you run your program (/usr/bin/foo), does it daemonize itself (kind of like running /usr/sbin/sshd), or would you have to do it yourself if run from the shell ('/usr/bin/foo &')?
    and does everything it should. I've noticed a couple of problems, though. If I execute an init 0, the system hangs and never gets to the OK prompt. If I disable my service, an init 0 completes without any problems. An init 5 works OK, as does a shutdown from the desktop. I'm not sure what could be causing this. I thought maybe because the service was restarted over and over again...?
    I gave my service a timeout value of "0", as I found that when I gave it any other value the service stopped running when the timeout expired. A seeming side effect is that my service is never listed as running, as it's start method (itself) hasn't yet completed.The manifest doesn't really want your binary as the start method. It wants to run something that starts the service, and will exit with status 0 if the startup was successful, and non-zero if the startup was unsuccessful. So you might want to write a small wrapper script (like an init.d startup script).
    Take a look at the sshd.xml manifest. It doesn't start sshd, it runs '/lib/svc/method/sshd start', which is responsible for starting sshd.
    Darren

  • XSLT linefeeds problem

    Hi,
    I have a XML and I wrote a XSL to transform the XML to another XML. The problem is of linefeed in the generated XML. See the output XML where everything comes in one line when I open the XML in notepad whereas my XSL is properly indented. What is the problem?
    Input XML -><?xml version="1.0" encoding="UTF-8"?>
    <Source>
         <FirstName>Bhushan</FirstName>
         <LastName>Bhangale</LastName>
    </Source>XSL -><?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml"/>
    <xsl:template match="/">
         <Result>
              <Name><xsl:value-of select="concat(Source/FirstName, ' ', Source/LastName"/></Name>
         </Result>
    </xsl:template>
    </xsl:stylesheet>Output XML -><?xml version="1.0" encoding="UTF-8"?>
    <Result><Name>Bhushan Bhangale</Name></Result>Java code which I am using ->import javax.xml.transform.*;
    import java.io.*;
    public class TransformXML {
    public static void main(String[] args) {
         try {
              TransformerFactory tFactory = TransformerFactory.newInstance();
              Transformer transformer = tFactory.newTransformer(new javax.xml.transform.stream.StreamSource("test.xsl"));
              transformer.transform(new javax.xml.transform.stream.StreamSource("input.xml"), new javax.xml.transform.stream.StreamResult( new FileOutputStream("output.xml")));
         catch (Exception e) {
              e.printStackTrace( );
    }

    Infact I found the standard way of doing it when searched a lot on google.
    <xsl:output method = "xml"
         version = "1.0"
         encoding = "UTF-8"
         omit-xml-declaration = "no"
         indent = "yes"
         media-type = "text/plain"/>
    The indent = "yes" solves the problem but not to the tabs extent. It only takes care of linefeed.

  • HELP: JSP + XML + XSLT = HTML?

    Hello, all.
    I am trying out Weblogic 6 and I am trying to get the JSP + XML + XSLT =>
    HTML chain working.
    I am coming from using Orion and SAXON.. and in that situation I had a JSP
    that contained XML tags... they were filled in at runtime and then using
    Servlet-Chaining was passed along to the SAXON XSLT Processer. SAXON checked
    for the inline XSL specified and then used that to transform the document
    into HTML.
    It worked well, but there were some other features missing/not documented
    that we now need.
    With Weblogic I am trying to use the XSLT Tag Library that comes with the
    distribution, but it seems to be very finicky. I followed the directions and
    I got it to do a sort of roundabout transformation. But it doesn't seem to
    work quite right.
    The best I can get is the following:
    I have an 'xslt' directory url-pattern-mapped to xslt.jsp (as instructed)...
    but can't figure out how to specify the xsl file on-the-fly... that is, if I
    don't hard-code the XSL file in the x:xslt element in the xslt.jsp it
    complains about some XML file not having a root element.
    Ideal situation:
    1. I have a JSP that includes XML elements.
    2. It is filled from a database at runtime and specifys (using a PI) what
    XSL stylesheet it is to be processed with.
    3. Somehow (fingers crossed) the XML is processed and transformed into HTML
    by the appropriate XSL file.
    I think I am mostly stuck moving between steps 2 and 3.
    Can anyone give me some hints? Are there some Weblogic specific
    elements/tags that I have to include in the XML file that Weblogic will
    catch and re-direct to the XSL Parser?
    Please, anyone, if you have some information, I would much appreciate it.
    Dylan Parker
    PS - I apologize for the cross-post, I hope it doesn't cause too much
    traffic.

    Craig,
    I've since discovered how to do it with the WL Taglibrary... and have
    moved on =)
    It has to do with the EXTREMELY BADLY documented x:xml tag that can
    appear within the x:xslt tag body...
    So the WL Tag Library allows something like the following.
    (Please note, angled brackets are omitted in this post to prevent html
    parsing)
    [x:xslt stylesheet="sheet.xsl"]
    [x:xml]
    Here is the XML to run the sheet on.
    This should have all relevant XML syntax: the PIs, the doctype,
    root elements etc...
    [x:xml]
    [x:xslt]
    And that DOES work. But not very well. WL, a little prematurely
    incorporated versions 1.2 of Xerces and Xalan in their product -- and
    these versions have some irritating bugs.
    Also -- There tag library doesn't copy the source XML across as UTF-8
    .. so a lot of the Japanese I have embedded there (from a DB) gets
    mangled somewhere in their code...
    AND -- If you hammer a little bit on an JSP/XML that uses the WL Tag
    Library (eg clicking refresh lots of times in IE)... I get huge
    amounts of irritating exceptions appearing in the log files.
    NullPointerExceptions
    XSL Parsing Exceptions
    XML Parsing Exceptions
    but completely unpredictably...
    In my eyes.. the WL XML/XSL Tag Library using the incorporated and
    untouchable Xalan and Xerces (v1.2) is virtually unusable.
    What a pain.
    BUT! Apache offers a similar OPEN SOURCE XSL Tag Library available
    here:
    http://jakarta.apache.org/taglibs/doc/xsl-doc/intro.html
    And it uses the standard, non-weblogic-incorporated, Xerces and Xalan
    (which means you can provide whatever version you want).. and it works
    impressively well.
    It has almost identical performance as the WL Taglib, and without all
    of the bizarre exceptions being thrown.
    And it does proper passing of the character encoding type!
    If only the taglib did caching though =(
    The performance hit over pure JSP is huge. Almost two orders of
    magnitude. On my desktop box I can get around 500Requests/Sec if I am
    returning HTML direct from a JSP... while if I produce XML that gets
    processed by XSL into HTML the Requests/Sec drops to 5!!!!
    Caching. Caching. And more Caching. A lot of DiskIO is going on with
    the XML/XSL/XHTML chain of events.
    I hope this helps!
    I'd be curious as to what you find out as well.
    Dylan Parker
    On 5 Mar 2001 07:20:00 -0800, "Craig Macha"
    <[email protected]> wrote:
    >
    Yep, I feel Dylan's pain.
    I am trying to accomplish the same thing. A JSP page generating
    dynamic XML content and then utilizing an XSLT stylesheet to transform
    all the content into XHTML.
    Does anyone have some examples that show exactly how to accomplish
    this? Can I do this with WLS and the XML taglib that comes with
    it? Or do I have to move on to something like Cocoon to get this
    capability?
    Any insight would be greatly appreciated.
    Thanks,
    Craig Macha
    "Dylan Parker" <[email protected]> wrote:
    Hello, all.
    I am trying out Weblogic 6 and I am trying to get the
    JSP + XML + XSLT =>
    HTML chain working.
    I am coming from using Orion and SAXON.. and in that situation
    I had a JSP
    that contained XML tags... they were filled in at runtime
    and then using
    Servlet-Chaining was passed along to the SAXON XSLT Processer.
    SAXON checked
    for the inline XSL specified and then used that to transform
    the document
    into HTML.
    It worked well, but there were some other features missing/not
    documented
    that we now need.
    With Weblogic I am trying to use the XSLT Tag Library
    that comes with the
    distribution, but it seems to be very finicky. I followed
    the directions and
    I got it to do a sort of roundabout transformation. But
    it doesn't seem to
    work quite right.
    The best I can get is the following:
    I have an 'xslt' directory url-pattern-mapped to xslt.jsp
    (as instructed)...
    but can't figure out how to specify the xsl file on-the-fly...
    that is, if I
    don't hard-code the XSL file in the x:xslt element in
    the xslt.jsp it
    complains about some XML file not having a root element.
    Ideal situation:
    1. I have a JSP that includes XML elements.
    2. It is filled from a database at runtime and specifys
    (using a PI) what
    XSL stylesheet it is to be processed with.
    3. Somehow (fingers crossed) the XML is processed and
    transformed into HTML
    by the appropriate XSL file.
    I think I am mostly stuck moving between steps 2 and 3.
    Can anyone give me some hints? Are there some Weblogic
    specific
    elements/tags that I have to include in the XML file that
    Weblogic will
    catch and re-direct to the XSL Parser?
    Please, anyone, if you have some information, I would
    much appreciate it.
    Dylan Parker
    PS - I apologize for the cross-post, I hope it doesn't
    cause too much
    traffic.

  • Exception in XML Parser (format problem?)

    Hi Experts,
    I am working on IDOC -> AS2 Configuration and the AS2 Configuration has the below structure
    <RecordSet>
         <Row1>
                       <row1 - field1>
                       <row1 - field2>
                       <row1 - field3>
         </Row1>
         <Row2>
                       <row2 - field1>
                       <row2 - field2>
                       <row2 - field3>
         </Row2>
         <Records>
              <Record1>
                        <Record1-Field1>
                        <Record1-Field1>
                        <Record1-Field1> 
              </Record1>
              <Record2>
                        <Record2-Field1>
                        <Record2-Field1>
                        <Record2-Field1> 
              </Record2>
         </Records>
    </RecordSet>
    We are getting the expected Structure when we AS2 Receiver has the xml format. But while doing module development with the strctxml2Plain, we are getting the below error  in RWB CC Monitoring.
    Message processing failed. Cause: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.NullPointerException''; nested exception caused by: java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.NullPointerException'
    Any ideas, why this error we are getting.....
    Thanks in advance,
    Regards,
    Vasu

    Hi Vasu,
    Not in the Mapping of IR.
    In BIC Mapping Designer you have to test with the standard Mappings by providing the sample file whether the Conversion is happening correctly or not.
    You have to take the same input file that what ever you are having now.
    So that it will say clearly what is the problem in converting the XMLto the required EDI Format...
    Check whether you have any Date Format Values are comming from the input file.
    Regards
    Seshagiri

  • Attempt to process file failed with Exception in XML Parser-format problem

    Hi all,
    Iam getting an unusual error in the J2EE stack in XI.
    And the message is:
    006-11-30 17:31:07 Error Attempt to process file failed with Exception in XML Parser (format problem?):'com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)(:main:, row=1, col=1044002) -> com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)' 2006-11-30 17:31:07 Error Exception caught by adapter framework: null 2006-11-30 17:31:07 Error Delivery of the message to the application using connection AFW failed, due to: RecoverableException.
    My scenerio iam posting IDOC to a flat file with content conversion in the receiver side,the mapping got executed successfully and in the audit log i found that the error was after the 'Start converting XML document content to plain text'.
    This means that error occured during content conversion of XML to the prescribed file format.
    Can anyone suggest any better approach using which we may trace the junk data in IDoc. Manual adhoc approach could take time and is error prone.
    Thanks in advance...
    karun

    Hi Bhavesh,
    Thanks for the early reply. I checked the mapping and everything is fine and the output is also in valid XML format.
    The audit log shows that the mapping got executed successfully and the error is after the step 'Start converting XML document content to plain text '. Is there any constraint in the file adapter regarding the message size for parsing.
    2006-11-30 17:30:50 Success Transfer: "BIN" mode, size 2912595 bytes, character encoding -
    2006-11-30 17:30:50 Success Start converting XML document content to plain text
    2006-11-30 17:31:07 Error Attempt to process file failed with Exception in XML Parser (format problem?):'com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)(:main:, row=1, col=1044002) -> com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)'
    2006-11-30 17:31:07 Error Exception caught by adapter framework: null
    2006-11-30 17:31:07 Error Delivery of the message to the application using connection AFW failed, due to: RecoverableException.
    2006-11-30 17:31:07 Success The asynchronous message was successfully scheduled to be delivered at Thu Nov 30 17:36:07 GMT 2006.
    2006-11-30 17:31:07 Success The message status set to WAIT.
    2006-11-30 17:31:08 Success Acknowledgement creation triggered for type: SystemErrorAck
    2006-11-30 17:31:08 Success Acknowledgement sent successfully for type: SystemErrorAck
    2006-11-30 17:36:08 Success Retrying to deliver message to the application. Retry: 1

  • How  use XSLT maping in XI

    Hi All
            I an new to XI .I need information about the XSLT maping .pls help me on this task
      Thanking  u.
    regards,
    ramesh

    Hi Ramesh,
    <b>Welcome to XI</b>
    Please go through the following links:
    Mapping:
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/b78d406b305537e10000000a1550b0/frameset.htm
    For Java Mapping:
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm
    For XSLT Mapping:
    http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/frameset.htm
    Error handling in XSLT Mapping:
    http://help.sap.com/saphelp_nw04/helpdata/en/8a/7672f7d7e444439fd7024f806221a4/frameset.htm
    You can also refer some How to guides:
    XI New Mapping Features article,
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi 3.0 new mapping features article.evn
    Generic XSLT Mapping and Sample Code,
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi code samples/generic xslt mapping and sample code.pdf
    How to use ABAP-MApping in XI3.0,
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/3.0/how to use abap-mapping in xi 3.0.pdf
    I hope it helps,
    Thanks & Regards,
    Varun Joshi

  • Xml schema validation problem

    Hi All
    How to tackle this xml schema validation problem
    i am using the sample code provided by ORacle technet for xml
    schema validation in the Oracle database(817).
    The sample code works perfectly fine.
    Sample as provided by http://otn.oracle.com/tech/xml/xdk_sample/archive/xdksample_093001.zip.
    It works fine for normal xml files validated against
    xml schema (xsd)
    but in this case my validation is failing . Can you let me know why
    I have this main schema
    Comany.xsd
    ===========
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.company.org"
    xmlns="http://www.company.org"
    elementFormDefault="qualified">
    <xsd:include schemaLocation="Person.xsd"/>
    <xsd:include schemaLocation="Product.xsd"/>
    <xsd:element name="Company">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="Person" type="PersonType" maxOccurs="unbounded"/>
    <xsd:element name="Product" type="ProductType" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    ================
    which includes the following 2 schemas
    Product.xsd
    ============
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified">
    <xsd:complexType name="ProductType">
    <xsd:sequence>
    <xsd:element name="Type" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    ==============
    Person.xsd
    ===========
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified">
    <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>
    =================
    now when i try to validate a xml file against Company.xsd
    it throws an error saying unable to find Person.xsd.
    no protocol error
    Now where do i place these 2 schemas(.xsd files) Person & product
    so that the java schemavalidation program running inside Oracle
    database can locate these files
    Rgrds
    Sushant

    Hi Jinyu
    This is the java code loaded in the database using loadjava called by a wrapper oracle stored procedure
    import oracle.xml.parser.schema.*;
    import oracle.xml.parser.v2.*;
    import java.net.*;
    import java.io.*;
    import org.w3c.dom.*;
    import java.util.*;
    import oracle.sql.CHAR;
    import java.sql.SQLException;
    public class SchemaUtil
    public static String validation(CHAR xml, CHAR xsd)
    throws Exception
    //Build Schema Object
    XSDBuilder builder = new XSDBuilder();
    byte [] docbytes = xsd.getBytes();
    ByteArrayInputStream in = new ByteArrayInputStream(docbytes);
    XMLSchema schemadoc = (XMLSchema)builder.build(in,null);
    //Parse the input XML document with Schema Validation
    docbytes = xml.getBytes();
    in = new ByteArrayInputStream(docbytes);
    DOMParser dp = new DOMParser();
    // Set Schema Object for Validation
    dp.setXMLSchema(schemadoc);
    dp.setValidationMode(XMLParser.SCHEMA_VALIDATION);
    dp.setPreserveWhitespace (true);
    StringWriter sw = new StringWriter();
    dp.setErrorStream (new PrintWriter(sw));
    try
    dp.parse (in);
    sw.write("The input XML parsed without errors.\n");
    catch (XMLParseException pe)
    sw.write("Parser Exception: " + pe.getMessage());
    catch (Exception e)
    sw.write("NonParserException: " + e.getMessage());
    return sw.toString();
    This is the code i used initially for validating a xml file against single xml schema (.xsd) file
    In the above code could u tell how to specify the second schema validation code for the incoming xml.
    say i create another Schemadoc for the 2nd xml schema.
    something like this with another parameter(CHAR xsd1) passing to the method
    byte [] docbytes1 = xsd1.getBytes();
    ByteArrayInputStream in1 = new ByteArrayInputStream(docbytes1);
    XMLSchema schemadoc1 = (XMLSchema)builder.build(in1,null);
    DOMParser dp = new DOMParser();
    How to set for the 2nd xml schema validation in the above code or can i combine 2 xml schemas.
    How to go about it
    Rgrds
    Sushant

  • XML/XSLT Newbie

    Hi All
    I'm want to dip my toe into the world of XML/XSLT development
    to help with
    job applications. Seems there's a lot of companies asking for
    this.
    I've been developing ASP applications for a number of years,
    but i've never
    looked at XML, etc...
    Can anyone provide a strating point, examples, etc? I'm also
    looking to
    learn .NET too (think i have a mountain to climb).
    I've been using Access database for my applications but also
    need to expand
    by using MS SQL on my local machine.
    Any ideas wher to start?
    Hope someone can point me in the right direction - Thanks in
    Adance
    Andy

    > Can anyone provide a strating point, examples, etc? I'm
    also looking to
    > learn .NET too (think i have a mountain to climb).
    And at the top of that mountain is a pile of .net XML
    applications. I can't
    say that's the motherland of software development, but, yea,
    it probably
    pays good. ;o)
    > Any ideas wher to start?
    Well, if you start using asp.net 2.0, a lot of the built-in
    controls
    leverage XML and XSLT, so you'll begin to get your hand dirty
    just going
    through the basic ASP.net 2.0 tutorials.
    -Darrel

  • JSP   vs.    XML/XSLT

    Hi all!
    I'm in a bit of a dilema. As the least knowledgable member of our small development group (3 people incl. me) I'm caught in the middle of a pretty fierce debate over whether or not to we should implement JSP.
    Currently to seperate business logic from presentation we have our servlets pass XML to the browser and then the browser renders the HTML using the appropriate .xsl (sometimes we use server-side transformation).
    Now one of the guys wants to use MVC/Struts and JSPs in order to create a much needed UI for an application. The plan is to not put any Java code in the JSP (seperation of logic and presentation - good, business logic in both the JSP and Servlet - bad.) but the other guy is still vehemently against it.
    He says that anything JSP can do we can already do with XML/XSLT and to add JSP to our environment would complicate things.
    And while I agree with him there, there are some things that when you do them with JSPs make the code more readable and transparent.
    If you had to take a side, which one would you choose?
    Has anyone else out there already gone through this debate? I'd be interested in knowing the outcome.
    Thanks,
    John

    I have a couple of comments.
    1> "XML to the browser and then the browser renders the HTML using the appropriate .xsl"
    I all cases you should do the transformations on the server. Lot of browser do not know how to
    do a xsl transform. And since you can do it some time why not do it not everytime?
    2> "business logic in both the JSP and Servlet"
    Business logic should neither be in servlets nor in jsp. I think they should be in business logic beans.
    3> "anything JSP can do we can already do with XML/XSLT "
    Although anything can be done using xml/xsl or jsp there are a bit of differences where struts-jsp architecture is more perferable.
    Imaging a web site which has lots of online forms(with textfiedls, checkboxes, select lists, etc) which are to be validated and if some validation fails the same form is to be shown with the values already submitted prefilled. Doing this with xml/xsl or even simple jsp could be a nightmare.
    But if you use struts MVC architecture with jsp and struts taglib this will be very very simple.
    Introducing struts-jsp will not complicate things and if the scnario described above is there or could arise in your application then you should seriously think about using struts+jsp. That does not mean you will have to scrap you xml+xsl architecture. You can still generate the xml using your action bean , put the xml in request and forward it to you jsp for rendetion. The jsp page could then use a taglib which has the xsl transformation code to do the xslt transformation.
    The above comments are not just my thoughts but i have also implemented/experienced the above during various projects and they have proved to be useful.
    Cheers!

  • OT:XML/XSLT transformations on iAS6.0 anyone?

    Hi,
    I know this is Off Topic from JATO, but...
    I am trying to come up with a way to process the typical
    transformation of xml & xslt to html.
    For whatever reason I can't seem to get this to work.
    I've tried it by writing my own servlet, but it hangs.
    I've tried to install cocoon, but nothing ever works, and all the
    installation instructions seem to trail off at the most important time
    (like what if the build doesn't create a war file).
    Can someone point to a definitive resource that I can follow for
    something like this which will work on iAS6.0?
    Thanks,
    John Hoskins.

    Yeah, off topic, so I doubt you will get any expert help here. Might try the S1AS 6.x forum.
    sorry

  • On XML, XSLT, FO usage

    Hi,
    Any links... help...documents... tutorials... samples on usage of XML, XSLT, FO engine, for pdf generation.
    Ravishankar Swamy

    Hi,
    This Technical Note is very interesting to start point
    http://www.oracle.com/technology/pub/notes/technote_vohra_fop.html
    Follow good references from AMIS
    http://technology.amis.nl/blog/?p=1102
    http://technology.amis.nl/blog/?p=1182
    Best regards

Maybe you are looking for

  • To open you need a Java SE 6 runtime. Why, when I have 1.7 installed?

    PREFACE: I've read most of the posts on here that discuss this issue but none have provided a real answer to this. I'm on Moutain Lion w/ all the latest updates from the App Store. I've installed Oracle's latest Java JDK (7u11) because of the recent

  • Losing sound when I burn DVDs

    Until today, I was always able to use iDVD 6 to create a DVD from any supported video format I happened to have on my Mac. Now I suddenly have problems. The project appears to encode and burn correctly, but when I attempt to play the DVD, either in t

  • Application sync issue

    I have the latest generation Ipod Touch with Version 3.1.2 on it and also an Iphone 3G. When I tried to sync my ipod touch tonight it removed applications from it first saying they were not compatible with my Ipod touch. When I hit sync again it said

  • Nokia Belle Refresh N8--Colorize IT

    I am from India I have N8 (Product code--0599255) and I cannot find Colorize IT on my phone after update.Please anyone help me to find it where it is located in the phone.Please also tell me if anyone got this Colorize IT on there phone after the upd

  • I am still waiting for my student approval to set up the Adobe creative suite. Can you please help?

    I am still waiting for my student approval to set up the Adobe creative suite. Can you please help? Jasper