DTD declaration
Hi,
I have an XML document to parse (specifically a WML). Its document type declaration is:
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
I'm not connected to the Internet while doing the parsing.
My question is, how do I turn off the validation process? The parsers always complained that it couldn't find www.wapforum.org host.
I already have
parser.setValidationMode(false);
Thanks,
Kerena
null
Hi,
I have an XML document to parse (specifically a WML). Its document type declaration is:
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
I'm not connected to the Internet while doing the parsing.
My question is, how do I turn off the validation process? The parsers always complained that it couldn't find www.wapforum.org host.
I already have
parser.setValidationMode(false);
Thanks,
Kerena
null
Similar Messages
-
Ignore DTD declaration in incoming XML message
Hi,
I have an issue where I am receiving an incoming XML message which starts with a DTD declaration.
This causes an issue with the XML parser step in the mapping because the parser attempts to resolve the DTD location. However this location is external and the PI server cannot access it.
The location for reference is http://dtd.bibit.com/paymentService_v1.dtd
Therefore I am investigating options to ignore the DTD declaration or removing it altogether prior to the XML parser step.
I would hope I could use either XSLT or Java mapping but do not really know where to start.
Can anyone please provide a method of doing this ? I would prefer to use XSLT but am open to other options.
I have no control over the DTD declaration as it is supplied by a 3rd party application.
Thanks
Colin.Hi Russell,
The XSLT sample you have provided does not work.
I still get the message below in the trace file:
<Trace level="2" type="T">Call XSLT processor with stylsheet BIBIT_PaymentResponse.xsl.</Trace>
<Trace level="2" type="T">resolveEntity systemId = 'http://dtd.bibit.com/paymentService_v1.dtd' (publicId = '-//Bibit//DTD Bibit PaymentService v1//EN').</Trace>
<Trace level="3" type="T">Search http://dtd.bibit.com/paymentService_v1.dtd (urn:com-dg-ng:crm:paycardauth, -1) in swcv 703fadc0-858c-11dd-971b-f2400a20801e.</Trace>
<Trace level="3" type="T">Search http://dtd.bibit.com/paymentService_v1.dtd (-1) in swcv 703fadc0-858c-11dd-971b-f2400a20801e without namespace.</Trace>
<Trace level="1" type="T">Resource not found: http://dtd.bibit.com/paymentService_v1.dtd Thrown: com.sap.aii.ib.server.mapping.execution.MappingClassNotFoundException: http://dtd.bibit.com/paymentService_v1.dtd at com.sap.aii.ib.server.mapping.execution.InternalMappingFinder.getInputStream(InternalMappingFinder.java:119) at com.sap.aii.ib.server.mapping.execution.InternalMappingFinder.readFile(InternalMappingFinder.java:62) at com.sap.aii.ib.server.mapping.execution.MappingLoader.getResourceAsStream(MappingLoader.java:131) at com.sap.aii.ib.server.mapping.execution.AbstractMappingTransformer$MappingEntityResolver.resolveEntity(AbstractMappingTransformer.java:328) at com.sap.engine.lib.xml.parser.XMLParser.scanDTD(XMLParser.java:1272) at com.sap.engine.lib.xml.parser.XMLParser.scanProlog(XMLParser.java:2804) at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2839) at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:229) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:145) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:160) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:261) at com.sap.engine.lib.xml.parser.Parser.parse_DTDValidation(Parser.java:282) at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:293) at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:126) at com.sap.aii.ib.server.mapping.execution.jaxpfactories.MappingXMLReader.parse(MappingXMLReader.java:102) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:387) at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:240) at com.sap.aii.ib.server.mapping.execution.AbstractMappingTransformer.transform(AbstractMappingTransformer.java:174) at com.sap.aii.ib.server.mapping.execution.XSLTMapping.executeStep(XSLTMapping.java:79) at com.sap.aii.ib.server.mapping.execution.Mapping.execute(Mapping.java:60) at com.sap.aii.ib.server.mapping.execution.SequenceMapping.executeStep(SequenceMapping.java:40) at com.sap.aii.ib.server.mapping.execution.Mapping.execute(Mapping.java:60) at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:87) at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:71) at com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleMappingRequest(MappingRequestHandler.java:119) at com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleRequest(MappingRequestHandler.java:72) at com.sap.aii.ibrun.sbeans.mapping.MappingServiceImpl.processFunction(MappingServiceImpl.java:79) at sun.reflect.GeneratedMethodAccessor310.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:43) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:71) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:38) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:22) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:189) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:21) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:133) at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:164) at $Proxy544.processFunction(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:183) at com.sap.engine.services.rfcengine.RFCJCOServer$J2EEApplicationRunnable.run(RFCJCOServer.java:269) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:152) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:247)</Trace>
I will try your Java mapping next and get back to you if I get success with this.
Cheers for your help.
Colin. -
A error of "bad DTD declaration"
Hi
when i use XDK for 9i(solaris) to parse the "xxxx.xml",
a error of "bad DTD declaration" (XMLERR_BAD_DTD) always be displayed. but when i get rid of the fragment of "<!DOCTYPE .... >" ,all of the parsing is correct.
why ?
regards,
donald
the fragment of "xxxx.xml" is follow as:
<?xml version="1.0" encoding="UTF-16"?>
<!DOCTYPE NewsML PUBLIC "urn:newsml:iptc.org:20001006:NewsMLv1.0.dtd:1" "../DTD/NewsMLv1.0.dtd" [
<!ENTITY % InContent SYSTEM "../DTD/InContentv1.0.dtd">
<!ENTITY % Kddata SYSTEM "../DHDTD/KdDHKgMLv1.0.dtd">
%InContent;%Kddata;
]>
<NewsML>
<InContent version="1.0">
</InContent version="1.0">
</NewsML>
the fragment of source is follow as:
if (!(xctx = xmlinitenc(&ecode, (const oratext *) 0,(const oratext *)0,
(void (*)(void *, const oratext *, uword)) func1,
(void *) 0, (const xmlsaxcb *) 0, (void *) 0,
(const xmlmemcb *) 0, (void *) 0,
(const oratext *) 0)))
if (ecode=xmlparse(xctx,(oratext *)argv[1],(oratext *)0,
XML_FLAG_VALIDATE | XML_FLAG_DISCARD_WHITESPACE))Can you provide the complete xml and dtd files?
-
Reg: adding DTD declaration using java
Dear All,
I want to add the document type declaration definition to xml file using java.
I am using ,
transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, "test.dtd");But it refers the specified dtd file....Can i add dtd definition directly....The dtd are as,
<!DOCTYPE test [
<!ATTLIST person nick ID #IMPLIED>
]>Is it any method to add the above...
Thanks,
Karthik.VIf you invoke the print method on the top-level ELEMENT, you get
just the body of the document with no DTD or XMLDecl. if you invoke
print on the top level NODE (the DOCUMENT node), then the output
document will contain the XMLDecl and DTD.
So please try to print from DOCUMENT node. -
DOM Parser Configuration...how to switch off DTD validation?
Hi all,
I am developing some implementation code in Java using JBuilder2005, in which DOM3 parser is also being utilised. Now the question is how to switch off DTD validation (seems its default mode is 'on') so that no validation will be carried out at all even DTD declaration statement is presented in an input XML document?
Many thanks in advance
FrankFirst of all, thank you so much for responding, DrClap. =)
setValidating(false) of the DocumentBuilderFactory instance, factory, does not work as expected; it still stubbornly try to seek the external DTD file and fires 'IOException' error in case of no such a DTD.
To follow up the EntityResolver approach, I searched online for almost the whole afternoon but still could not figure out how to do it exactly. In particular, I found http://www.jdom.org/docs/faq.html#a0350, which tells a way doing it, but I got 'StringBufferInputStream is deprecated' error. Then I changed to
new InputStream(new ByteArrayInputStream("".getBytes()))adapted from http://forum.java.sun.com/thread.jspa?threadID=572919&messageID=2842185. But another error occurs: 'java.io.InputStream is abstract; cannot be instantiated'. Furthermore, I have looked at many docs(tutorials, APIs...) on parser configuration, usage of EntityResolver/setEntityResolver()...but they turned out not helpful. Could you please give out more details on how to do this using EntityResolver?? Many many thanks... -
Oracle 10g XMLDB - how to ignore inline references to DTD
Is there a way to tell oracle XMLDB to ignore validating XML that has an inline DTD declaration? I'm just want to store the XML (as XMLType) in a column. All the XML's have an inline DTD declaration but I want to ignore it. Is there a way to tell oracle to do so?
Thanks in advance!Hi,
I dont know sql server 2005. But by observing it I feel you are generating sql dynamically based on condition inside the proc.
DECLARE
TYPE EmpCurTyp IS REF CURSOR;
emp_cv EmpCurTyp;
emp_rec employees%ROWTYPE;
sql_stmt VARCHAR2(200);
v_job VARCHAR2(10) := 'ST_CLERK';
BEGIN
sql_stmt := 'SELECT * FROM employees WHERE job_id = :j';
OPEN emp_cv FOR sql_stmt USING v_job;
LOOP
FETCH emp_cv INTO emp_rec;
EXIT WHEN emp_cv%NOTFOUND;
DBMS_OUTPUT.PUT_LINE('Name: ' || emp_rec.last_name || ' Job Id: ' ||
emp_rec.job_id);
END LOOP;
CLOSE emp_cv;
END;something like this it will be. it is in oracle documentaion
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/dynamic.htm#i14500 -
The hunt for the lost Config.dtd
Does anyone know if there's a link to the real config.dtd file anywhere?
Perhaps it's just me misunderstanding the "rules" about xml, that you're
supposed to refer to a link to the dtd file used for an xml file.
I'm aware off the fact that BEA has the link
edocs.bea.com/wls/docs60/config_xml/config.html#326936, in which the dtd
is included in an html document, however, I would like to have it as a
real dtd file without links and stuff.
For example, web.xml, http://java.sun.com/j2ee/dtds/web-app_2_2.dtd.
If anyone knows the whereabouts off config.dtd, I would be very grateful
for a tip.
sincerely,
Christopher Suarez
[email protected]You actually don't HAVE to include a DTD declaration in your XML doc unless
you want to use a parser in validating mode. In fact, I never do DTD
validation since it's a big performance hit....
- Navneet
"Christopher Suarez" <[email protected]> wrote in message
news:[email protected]..
Does anyone know if there's a link to the real config.dtd file anywhere?
Perhaps it's just me misunderstanding the "rules" about xml, that you're
supposed to refer to a link to the dtd file used for an xml file.
I'm aware off the fact that BEA has the link
edocs.bea.com/wls/docs60/config_xml/config.html#326936, in which the dtd
is included in an html document, however, I would like to have it as a
real dtd file without links and stuff.
For example, web.xml, http://java.sun.com/j2ee/dtds/web-app_2_2.dtd.
If anyone knows the whereabouts off config.dtd, I would be very grateful
for a tip.
sincerely,
Christopher Suarez
[email protected] -
Synth.dtd not valid XML
Hi. I'm trying to make my own Look&Feel with Synth. I'm reading stuff here, and nothing will work because [synth.dtd|http://java.sun.com/javase/6/docs/api/javax/swing/plaf/synth/doc-files/synth.dtd] is all messed up and won't validate in NetBeans.
If anyone could help me with this problem it would be really nice.
Thanks, BoB.This is not unusual to see if you are missing a tag, the tag ordering is
wrong or you have some extra characters in the descriptor.
I reproduced the same error by adding the invalid characters <> before
<weblogic-web-app> tag that should begin the document after the dtd
declaration.
Patrick
"Richard Dedeyan" <[email protected]> wrote in message
news:3ebfbb76$[email protected]..
>
Hi All,
In Weblogic 7, the dtd for the weblogic.xml file(http://www.bea.com/servers/wls700/dtd/weblogic700-web-jar.dtd)
seems to be invalid.
When deploying a web app, I get the error message:
"org.xml.sax.SAXParseException: The markup in the document preceding theroot
element must be well-formed"
Has anyone else experienced this problem?
Thanks,
Richard -
I am using Parser for Java v1.0.1.3 and am trying to reference
a dtd from an xml doc through a URI.
Is the following dtd declaration inside an xml doc correct?
<!DOCTYPE prog SYSTEM "http://bugs.yorku.ca/Chat.dtd">
I get the follwing error:
An Internal Error occurred. Please post a Bug report to the XML
Discussion forum at http://technet.oracle.com <>
at oracle.xml.parser.XMLParser.parse(XMLParser.java:284)
at oracle.xml.parser.XMLParser.parse(XMLParser.java:247)
at axml.AXML.validateXML(AXML.java:660)
at axml.AXML.main(AXML.java:700)
Thanks for your help,
bernard :)
Bernard Matutat
Department of Computer Science
York University
4700 Keele St., North York, Ontario, Canada, M3J 1P3
nullBernard Matutat (guest) wrote:
: I am using Parser for Java v1.0.1.3 and am trying to reference
: a dtd from an xml doc through a URI.
: Is the following dtd declaration inside an xml doc correct?
: <!DOCTYPE prog SYSTEM "http://bugs.yorku.ca/Chat.dtd">
: I get the follwing error:
: An Internal Error occurred. Please post a Bug report to the XML
: Discussion forum at http://technet.oracle.com <>
: at oracle.xml.parser.XMLParser.parse
(XMLParser.java:284)
: at oracle.xml.parser.XMLParser.parse
(XMLParser.java:247)
: at axml.AXML.validateXML(AXML.java:660)
: at axml.AXML.main(AXML.java:700)
: Thanks for your help,
: bernard :)
: Bernard Matutat
: Department of Computer Science
: York University
: 4700 Keele St., North York, Ontario, Canada, M3J 1P3
While your declaration has correct syntax, we did not
support http declarations in the SYSTEM identifier in v1. It is
fully supported in v2.
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
null -
Using Sun Web Server 6.1 from the IDE
Using JSE 8 with Sun Web Server 6.1 set as the target container, I have a SUNWS61deployment.xml file created.
That didn't exist in JSE 7. Is it WS 6.1 SP4 or SP5 -related ?
I also have ws61-sun-web.xml with a simple <sun-web-app/> tag (empty deployment descriptor).
What should this file contain? Is it a replacement for sun-web.xml?
Do I still need sun-web.xml? Its DTD declaration sounds like Sun
App Server 7 (http://www.sun.com/software/sunone/appserver/dtds/sun-web-app_2_3-1.dtd)
So you have plans to make "Sun Resources" (pools, JNDI resources, ...) created in the IDE be registerable directly in the Web Server just like it's possible with the sun app server?
How safe is it to use JSE 8 with an older Web Server Service Pack (say 6.1SP1)?SUNWS61deployment.xml is created bythe IDE to be used internally and not to be used by the developer. This file wouldn't be sent to webserver after deployment.
The ws61-sun-web.xml is sun-web.xml only and yes it is same as it is in Appserver7 as the webcontainer for both Webserver6.1 and Appserver7 are same. After deployment to webserver, ws61-sun-web.xml is renamed to Webserver as sun-web.xml by the IDE. When opened the developer can edit in the XML editor.
The reason for having it as ws61-sun-web.xml in IDE is to avoid the clash between sun-web.xml of Appserver8.1 which is J2EE1.4 based whereas Webserver6.1 Web container is J2EE1.3 based.
It should be okay to use any service pack of Webserver6.1 with JSE8
Hope this helps -
Problem in getEelementById() method-null pointer exception
Hi All,
I am using DocumentBuilder factory for parsing a xml file.
I am getting the document object and also creating an element in
the root element .And also I am setting the element id for the
element as attiribute .I need to select the element having same ID
using getElementById() method .But it is giving null pointer
exception.
N.B: My parsing file contains dtd declaration and root element.
My sample code look like this;
DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance();
DocumentBuilder db=dbf.newDocumentBuilder();
Document doc=db.parse(ne File("C:/index.xml");
Element root t=doc.getDocumentElement();
root.setAttribute("ID","12345");
Element oElement = doc.createElement(element_name);
oElement.setAttribute("ID",element_id);
Element oEle=doc.getElementById(element_id);
Could anyone please to solve this problem.
Please do favour with me.
Thanks and Regards,
Sreekanthwhile creating xml you should mention which attribute is ID attribute using
setIDAttribute() method,
as you are setting "ID" attribute as ID so
after adding Id attribute to the root element
use setIDAttribute("ID",true);
then getElementById will return the element by using ID
regards
shivakumar.T -
XSLT Interface Mapping Not Found For HTTP Response
NW 04's SR 10, RFC => XSL => HTML
The scenario transforms data from R/3 into XML using XSLT and sends it to a 3rd party vendor wrapped inside a field of an HTML form via the HTTPS adapter. XSL was used for this instead of standard MessageMapping to meet the customer's needed for the XML data to be delivered in an untransformed structure, including their DTD declaration, so they could parse it upon receipt.
The outbound process is successful and the data is posted to the customer's database. Upon receipt, they send back a simple HTML form containing the success/failure in an H1 tag and our submitted XML data in the Body tag.
The problem is that due to the use of an XSL as the outbound mapping XI does not have a cached message structure to which it can map the response and thus throws the <b>Interface mapping .... does not exist in runtime cache</b> message. I do not feel this is a cache problem since I've cleared the XI cache, CPACache and anything else I've read as well as verified that the outbound mapping exists in the XI Cache list. I honestly feel I'm just missing a necessary piece to tell XI how to map the HTML response message back to the RFC Sender.
I have attempted numerous ideas, one of which included the use of the same RFC structure as the inbound and outbound MessageType so that a Response mapping could be specified but a NullPointerException was thrown in the mapping step since the response was of a completely different structure.
My question is how to handle the return data when using XSLT to create the outbound structure dynamically to prevent runtime errors in XI?
Thanks in advance,
LaneThanks for the quick response Bhavesh.
I figured out the response mapping option after I posted the question and also thought of using XSL to handle the response but I ran into a few other issues relating to my limited experience with XSLT that is preventing me from completely solving this.
The response is a plain HTML file structured as:
< html >
< body >
< h1 >Success/FailureMessage< /h1 >
< br >
Record Created
< br >< br > XML Data: <?xml version="1.0" encoding="utf-8"?><!DOCTYPE ....
< /body >
< /html >
where the actual XML data posted to the client system is embedded in the HTML body. Therefore the response is not well-formed XML and fails on parsing but also contains another XML message within the HTML structure that throws off parsing as well. Do you know XSLT well enough to get around this?
What about writing a Java function that just reads the incoming information but in doing this how do I go about mapping back to the RFC? Can I get ahold of the XI API somewhere to instantiate the RFC Objects dynamically?
Thanks again,
Lane -
Plug-in w/ different default installation option
by default, when the java plug-in is installed in windows,
the registry entry UseJava2IExplorer is set to 1.
that is, the sun jvm becomes the default handler for
the <APPLET> tag.
i would like to be able to redistribute the plug-in but
with a different default: keep the ms vm the default.
(i don't want to manually change the default after installation)
so i opened the cab file, and noticed the .inf file references
http://java.sun.com/products/plugin/autodl/jinstall-1_4_1_02-windows-i586.xml
here's a snippet:
<jinstall>
<configuration version="1.0">
<jre language="English">
<description>Java 2 Standard Edition...</description>
<version>1.4.1_02</version>
<url>http://java.sun.com/webapps/download/...</url>
<options />
</jre> ...
</configuration>
</jinstall>
i want to know more about this file format. there's no dtd
declaration or xml schema reference. might the <options>
tag support something like:
<option name="UseJava2IExplorer" value="0" /> ?
i'd welcome any other ideas on how to override the default.
the plug-in documentation mentions using a silent installation;
i have two issues with this: [1] while recording, it seemed
to skip the part in the wizard where it asks you which vm to
default to; [2] how to go from a command line expression for
installing the plug-in in silent mode to a packaged mechanism
(maybe i should read the packagefortheweb documentation)
thanks, eitaneitan,
This is exactly what I would like to do as well.
Have you by chance found a way to do this?
Thanks in advance for any and all help!
Bob -
Hi all,
Am releatively new to weblogic and am migrating my web app from the tomcat container to weblogic 9.2
I use a XerxesImpl jar to parse my XML using a DOMParser and I dont want to use any libraries provided by weblogic atleast now!!
It always gives the SAXParserException, but the same bit of code works fine with the tomcat container.
I have also checked for the well-formedness of the xml and the xml and the dtd looks fine.
Any inputs on this would help!
Thnx
CyrusThe solution to this being that ---
1. Whenever using the local jar file for any XML parsing such as XerxesImpl.jar the weblogic provided services may try to override it and hence must be added on to the classpath before the ap[plication is deployed.
2.Also that somtimes the pageContext.getServletContext() returns a null and hence some other means mustbe found to find the corresponding xml file.(probably loading it as an initparam)
3. Also make sure that your xml matches the dtd declarations since atomcat container doesnt validate this but the weblogic container. -
How to use STRANS to translate XML to ABAP with deep structure
every experts, I want to use Tcode: STRANS to translate XML to ABAP, But it does not work well,
here is XML code,I want to translate this XML into an an Inter table gt_orders with deep structure of oeb, and colum oeb is also and intertable,how can I do this.
<?xml version="1.0" encoding="gb2312" ?><axmt410><ObjectID>setSalesOrder</ObjectID><azp01>000000</azp01><oea00>1</oea00><ta_oeaecn>SO-140227-3041</ta_oeaecn><oea03>25325017</oea03><oea02>2014-02-27 17:44:44.0</oea02><ta_oea002>2763.0</ta_oea002><ta_oea001>0.0</ta_oea001><oea14></oea14><oea15>25325017</oea15><oea23>RMB</oea23><oeaconf>S3</oeaconf><oea10></oea10><oeaud01>null</oeaud01><ta_oea007></ta_oea007><oea25>101</oea25><ta_oea008>0</ta_oea008><ta_oea009>null</ta_oea009><oeauser>Hanjingya</oeauser><ta_oeanday>2014-02-27 17:44:44.991</ta_oeanday><ta_oeamday>2014-02-28 08:30:14.866</ta_oeamday><ta_oeacday>2014-02-28 08:30:14.866</ta_oeacday><oeaud02>0</oeaud02><ta_oea030>null</ta_oea030><oeb><oeb03>1</oeb03><oeb04>7400208249</oeb04><oeb05>PCS</oeb05><oeb17>921.0</oeb17><oeb13>921.0</oeb13><oeb15></oeb15><oeb12>5</oeb12><oeb09>990001</oeb09><ta_oeb001></ta_oeb001><ta_oeb002>Yunnan</ta_oeb002><ta_oeb003>address1</ta_oeb003><ta_oeb004>zhangdagui、zhanglan</ta_oeb004><ta_oeb005>15974749998、15987782008</ta_oeb005><ta_oeb006>address and street</ta_oeb006><oebud01></oebud01></oeb><oeb><oeb03>2</oeb03><oeb04>7400208250</oeb04><oeb05>PCS</oeb05><oeb17>921.0</oeb17><oeb13>921.0</oeb13><oeb15></oeb15><oeb12>5</oeb12><oeb09>990001</oeb09><ta_oeb001></ta_oeb001><ta_oeb002>Yunnan</ta_oeb002><ta_oeb003>address2</ta_oeb003><ta_oeb004>zhangdagui、chenlan</ta_oeb004><ta_oeb005>15974749998、15987782008</ta_oeb005><ta_oeb006>address and street</ta_oeb006><oebud01></oebud01></oeb></axmt410>
I write these codes in SAP XSLT editor
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output encoding="iso-8859-1" indent="yes" method="xml" version="1.0"/>
<xsl:strip-space elements="*"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<ORDERS>
<xsl:apply-templates select="//axmt410"/>
</ORDERS>
</asx:values>
</asx:abap>
</xsl:template>
<xsl:template match="axmt410">
<OBJECTID>
<xsl:value-of select="ObjectID"/>
</OBJECTID>
<AZP01>
<xsl:value-of select="azp01"/>
</AZP01>
<OEA00>
<xsl:value-of select="oea00"/>
</OEA00>
<TA_OEAECN>
<xsl:value-of select="ta_oeaecn"/>
</TA_OEAECN>
<OEA03>
<xsl:value-of select="oea03"/>
</OEA03>
<OEA05>
<xsl:value-of select="oea05"/>
</OEA05>
<OEA02>
<xsl:value-of select="oea02"/>
</OEA02>
<TA_OEA002>
<xsl:value-of select="ta_oea002"/>
</TA_OEA002>
<TA_OEA001>
<xsl:value-of select="ta_oea001"/>
</TA_OEA001>
<OEA14>
<xsl:value-of select="ora14"/>
</OEA14>
<OEA15>
<xsl:value-of select="ora15"/>
</OEA15>
<OEA23>
<xsl:value-of select="ora23"/>
</OEA23>
<OEACONF>
<xsl:value-of select="oeaconf"/>
</OEACONF>
<OEA10>
<xsl:value-of select="ora10"/>
</OEA10>
<OEAUD01>
<xsl:value-of select="oeaud01"/>
</OEAUD01>
<TA_OEA007>
<xsl:value-of select="ta_oea007"/>
</TA_OEA007>
<OEA25>
<xsl:value-of select="ora25"/>
</OEA25>
<TA_OEA008>
<xsl:value-of select="ta_oea008"/>
</TA_OEA008>
<TA_OEA009>
<xsl:value-of select="ta_oea009"/>
</TA_OEA009>
<TA_OEA013>
<xsl:value-of select="ta_oea013"/>
</TA_OEA013>
<TA_OEA014>
<xsl:value-of select="ta_oea014"/>
</TA_OEA014>
<TA_OEA015>
<xsl:value-of select="ta_oea015"/>
</TA_OEA015>
<TA_OEA016>
<xsl:value-of select="ta_oea016"/>
</TA_OEA016>
<TA_OEA017>
<xsl:value-of select="ta_oea017"/>
</TA_OEA017>
<TA_OEA018>
<xsl:value-of select="ta_oea018"/>
</TA_OEA018>
<TA_OEA019>
<xsl:value-of select="ta_oea019"/>
</TA_OEA019>
<TA_OEA020>
<xsl:value-of select="ta_oea020"/>
</TA_OEA020>
<TA_OEA021>
<xsl:value-of select="ta_oea021"/>
</TA_OEA021>
<TA_OEA022>
<xsl:value-of select="ta_oea022"/>
</TA_OEA022>
<TA_OEA028>
<xsl:value-of select="ta_oea028"/>
</TA_OEA028>
<OEAUSER>
<xsl:value-of select="oeauser"/>
</OEAUSER>
<TA_OEANDAY>
<xsl:value-of select="ta_oeanday"/>
</TA_OEANDAY>
<TA_OEAMDAY>
<xsl:value-of select="ta_oeamday"/>
</TA_OEAMDAY>
<TA_OEACDAY>
<xsl:value-of select="ta_oeacday"/>
</TA_OEACDAY>
<OEAUD02>
<xsl:value-of select="oeaud02"/>
</OEAUD02>
<TA_OEA030>
<xsl:value-of select="ta_oea030"/>
</TA_OEA030>
<OEB>
<xsl:for-each select="oeb">
<OEB03>
<xsl:value-of select="oeb03"/>
</OEB03>
<OEB04>
<xsl:value-of select="oeb04"/>
</OEB04>
<OEB05>
<xsl:value-of select="oeb05"/>
</OEB05>
<OEB17>
<xsl:value-of select="oeb17"/>
</OEB17>
<OEB13>
<xsl:value-of select="oeb13"/>
</OEB13>
<OEB15>
<xsl:value-of select="oeb15"/>
</OEB15>
<OEB12>
<xsl:value-of select="oeb12"/>
</OEB12>
<OEB09>
<xsl:value-of select="oeb09"/>
</OEB09>
<TA_OEB001>
<xsl:value-of select="ta_oeb001"/>
</TA_OEB001>
<TA_OEB002>
<xsl:value-of select="ta_oeb002"/>
</TA_OEB002>
<TA_OEB003>
<xsl:value-of select="ta_oeb003"/>
</TA_OEB003>
<TA_OEB004>
<xsl:value-of select="ta_oeb004"/>
</TA_OEB004>
<TA_OEB005>
<xsl:value-of select="ta_oeb005"/>
</TA_OEB005>
<TA_OEB006>
<xsl:value-of select="ta_oeb006"/>
</TA_OEB006>
<OEBUD01>
<xsl:value-of select="oebud01"/>
</OEBUD01>
</xsl:for-each>
</OEB>
</xsl:template>
</xsl:transform>
and I use below ABAP program for a test, but the items from XML can not translate into Interner table gt_orders-oeb[]
TYPE-POOLS abap.
CONSTANTS gs_file TYPE string VALUE 'C:\temp\order02.xml'.
* This is the structure for the data from the XML file
TYPES:
BEGIN OF typ_s_oeb,
oeb03 TYPE string, "
oeb04 TYPE string, "
oeb05 TYPE string, "
oeb17 TYPE string, "
oeb13 TYPE string,
oeb15 TYPE string,
oeb12 TYPE string, "
oeb09 TYPE string, "
ta_oeb001 TYPE string, "
ta_oeb002 TYPE string, "
ta_oeb003 TYPE string, "
ta_oeb004 TYPE string, "
ta_oeb005 TYPE string, "
ta_oeb006 TYPE string, "
ta_oeb013 TYPE string, "
ta_oeb014 TYPE string, "
ta_oeb015 TYPE string, "
ta_oeb016 TYPE string, "
ta_oeb017 TYPE string, "
ta_oeb018 TYPE string, "
ta_oeb019 TYPE string, "
ta_oeb020 TYPE string, "
ta_oeb021 TYPE string, "
ta_oeb022 TYPE string, "
oebud01 TYPE string, "
END OF typ_s_oeb.
TYPES: typ_t_oeb TYPE TABLE OF typ_s_oeb WITH KEY oeb03.
TYPES:
BEGIN OF typ_s_order,
objectid TYPE string, "
azp01 TYPE string, "
oea00 TYPE string, "
ta_oeaecn TYPE string, "
oea03 TYPE string, "
oea02 TYPE string, "
ta_oea002 TYPE string, "
ta_oea001 TYPE string, "
oea14 TYPE string, "
oea15 TYPE string,
oea23 TYPE string, "
oeaconf TYPE string, "
oea10 TYPE string, "
oeaud01 TYPE string, "
ta_oea007 TYPE string, "
oea25 TYPE string, "
ta_oea008 TYPE string, "
ta_oea009 TYPE string, "
oeauser TYPE string, "
ta_oeanday TYPE string, "
ta_oeamday TYPE string, "
ta_oeacday TYPE string, "
oeaud02 TYPE string, "
ta_oea030 TYPE string, "
ta_oea013 TYPE string,
ta_oea014 TYPE string,
ta_oea015 TYPE string,
ta_oea016 TYPE string,
ta_oea017 TYPE string,
ta_oea018 TYPE string,
ta_oea019 TYPE string,
ta_oea020 TYPE string,
ta_oea021 TYPE string,
ta_oea022 TYPE string,
ta_oea025 TYPE string,
oeb TYPE typ_t_oeb,
END OF typ_s_order.
* Table for the XML content
DATA: gt_itab TYPE STANDARD TABLE OF char2048,
gs_itab LIKE LINE OF gt_itab.
* Table and work ares for the data from the XML file
DATA: gt_orders TYPE STANDARD TABLE OF typ_s_order,
gs_orders TYPE typ_s_order.
* Result table that contains references
* of the internal tables to be filled
DATA: gt_result_xml TYPE abap_trans_resbind_tab,
gs_result_xml TYPE abap_trans_resbind.
* For error handling
DATA: gs_rif_ex TYPE REF TO cx_root,
gs_var_text TYPE string.
* Get the XML file from your client
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = gs_file
CHANGING
data_tab = gt_itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
not_supported_by_gui = 17
error_no_gui = 18
OTHERS = 19.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* Fill the result table with a reference to the data table.
* Within the XSLT stylesheet, the data table can be accessed with
* "IPERSON".
GET REFERENCE OF gt_orders INTO gs_result_xml-value.
gs_result_xml-name = 'ORDERS'.
APPEND gs_result_xml TO gt_result_xml.
* Perform the XSLT styleshee
TRY.
CALL TRANSFORMATION zfx_so_xml_to_abap
SOURCE XML gt_itab
RESULT (gt_result_xml).
CATCH cx_root INTO gs_rif_ex.
gs_var_text = gs_rif_ex->get_text( ).
MESSAGE gs_var_text TYPE 'S'.
ENDTRY.
LOOP AT gt_orders INTO gs_orders.
ENDLOOP.The simplest way seems to me is to use a XSL file for that. The <xsl:output> attributes doctype-system and doctype-public generate the DTD declaration <!DOCTYPE YOUR_ROOT SYSTEM "yourDTDfile.dtd"> and <!DOCTYPE YOUR_ROOT PUBLIC "yourDTDfile.dtd">, respectively.
When calling transformerInstance.transform() the XSLT processor performs the identity transformation - it just copies elements, attributes, content, processing instructions and comments to the result stream.
If you're using an xsl file for your transformation already, simply add <xsl:output doctype-system="yourDTDfile.dtd"/> to your existing XSL file.
If you're only using the identity transformation you'd need to change the line of code where you obtain the transformer instance from the TransformerFactory to:
t_factory.newTransformer(new StreamSource("test.xsl"));
and use this as test.xsl:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output doctype-system="yourDTDfile.dtd"/>
<!-- this is the identity transformation -->
<xsl:template match="*|@*|comment()|processing-instruction()|text()">
<xsl:copy>
<xsl:apply-templates select="*|@*|comment()|processing-instruction()|text()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>Good luck.
Maybe you are looking for
-
Difference between aggregation and calculation tab in BEx Query Designer
HI, I am using BEx Query Designer for my report, for the key figures in the coloumn area i slected one numeric key figures, in the properties tab i found aggregation tab and calculation tab. I need to sum up the total values for that particualar col
-
My mac has a "Kernel Panic" screen come up on start up. No matter what I try I can't get past this to fix it. Any hints out there? Do I have to completely wipe my drive and re-install to fix this? I can't even back up my files before doing this as li
-
How can we pass the master report value in to detail report
Hi All, My question is how can I pass the master report value in to detail (Child) report filter? I mean I have one master report if I click on employee name then I have to pass the employee id in to details report filter. Then detail report will dis
-
Network - Windows connecting to Mac printer.
I'm having trouble getting Windows XP to print to the Mac shared printer - It says its getting the drivers, and then the printer shows up in options, but when I print to it, the printer just never prints. How do I get it to actually print? Brian
-
hi experts. iam trying to do the Out bound interfaces in abap. the requirment is like this, i hav to get the fields like invoice no, invo date, invo Amt, paid Amt ,balance and corrency from the BSID. i hav to generate a text file and place it on the