How to skip XML tags in Simple transformation
Hi,
I am trying to convert an XML file to ABAP code using Simple Transformations.
I tired converting a small XML file to ABAP using it and it worked fine.
The problem is that the number of tags in the XML file I now want to parse is huge (over 200).
Is there any way that for the tag in XML corresponding tag is not created in ST? Is there any conditional tag to achieve this?
Also, is Simple Transformation a better way of parsing in such a scenario over XSLT and DOM parser?
Thanks and Regards,
Neha
Edited by: Neha Anand on Jun 2, 2008 1:19 PM
Hi Raja,
I have already looked through the code snippets and I am able to write a CALL TRANSFORMATION.
I want to find out if the number of tags is huge then if there is any way that some tags can be skipped for matching tags in XML which anyhow I dont need for manipulation.
Thanks and Regards,
Neha
Similar Messages
-
Optional XML fields in Simple transformations (ST)
Hi, I am using Simple Transformation (ST) to convert an XML file into ABAP data. In my XML file some XML tags are optional: sometimes they are available in the file, sometimes they are not. I can not find out how to define a ST for this.
Either the XML fields are in the ST definition and then these field should also be in the XML file or
the XML fields are not in the ST definition and then these fields are not allowed in the XML.
Regards jackHi Jack, please find some sample coding below that will solve your issue:
<tt:cond check="not-initial(ref('E1EDL20.INCO1'))">
<INCO1 tt:value-ref="E1EDL20.INCO1"/>
</tt:cond>
With the simple transformation tt cond statment you can make an XML tag optional. In below example during deserialisation xml tag <INCO1> will be skipped when not availabke in the xml and SAP data E1EDL20.INCO1 will not be filled by the transformation.
Regards. Please give points when usefull ! -
How to escape special characters in Simple Transformation
Hi Experts,
I have got a problem to get a well formed xml document from the below simple transformation. The content of maktx contains
special characters like & <, which are not allowed in a well formed XML-Document. But the result of the Simple Transformation
contains this charcters even after the transformation as you can the in the result below. Has anyone a hint how to escape the
characters included in the maktx.
The transformation for maktx, should be something like
Before: Material & < TEST
After: Material & < TEST
Report wihich calls the simple transformation
types:
BEGIN OF t_mat,
matnr type matnr,
maktx type maktx,
end of t_mat.
Data:
mat type t_mat,
xml_stream type xstring.
START-OF-SELECTION.
mat-matnr = '4711'.
mat-maktx = 'Material & < Test'.
CALL TRANSFORMATION ztest_st2
SOURCE mat = mat
RESULT XML xml_stream.
CALL FUNCTION 'DISPLAY_XML_STRING'
EXPORTING xml_string = xml_stream.
Simple Transformation
<?sap.transform simple?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
<tt:root name="MAT"/>
<tt:template>
<Leistungsschild>
<CHARACT> MATNR </CHARACT>
<CHARACT_DESCR> Materialnummer </CHARACT_DESCR>
<VALUE tt:value-ref="MAT.MATNR"/>
<CHARACT> MAKTX </CHARACT>
<CHARACT_DESCR> Materialkurztext </CHARACT_DESCR>
<VALUE tt:value-ref="MAT.MAKTX" />
</Leistungsschild>
</tt:template>
</tt:transform>
RESULT
<?xml version="1.0" encoding="utf-8" ?>
<Leistungsschild>
<CHARACT>MATNR</CHARACT>
<CHARACT_DESCR>Materialnummer</CHARACT_DESCR>
<VALUE>4711</VALUE>
<CHARACT>MAKTX</CHARACT>
<CHARACT_DESCR>Materialkurztext</CHARACT_DESCR>
<VALUE>Material & < Test</VALUE> </Leistungsschild>Hi Sandra,
First of all thaks for your quick answer to my problem.
I see what you mean and get the same result, if I am using data-type string instead of xstring. But the recommendation in the XML-Books of SAP is to use XSTRING to save memory and circumflex problems between Codepages, when writing the XML-Stream to a filesystem.
As you can see in the code abvoe I am using a SAP-FM to display the XML-Stream and this FM works only with XSTRING´s,
that is one reason why I don´t understand that it displays it in the wrong way.
Even the Debugger shows me for the XSTRING the wrong result. Does all that mean that the escaping will not be applyed if you are working with XSTING´s?? -
How to change XML Tag sequence in XML Publisher Reports
Hi Experts,
I am working on XML Publisher reports, EBS 11I and Database 9i. I have standard report 'PO Printed Purchase Order Report (XML)', it's output type is XML. I want to change the sequence of groups in XML file.
I am getting XML tags like below at present:
LIST_G_HEADERS \ G_HEADERS \ LIST_G_HEADER_NOTES
I want to change the sequence of groups like below.
LIST_G_HEADERS \ G_HEADERS \ LIST_G_LINES \
Could somebody help me how to change the sequence of XML Groups.
Thanks in advance.Paul,
This works. Thanks!
I am still working through the implications of having a data connection defined. I notice that every time I submit, it creates two records in my database, one with all the fields blank, and one with the data and attachment.
I will have to do some more digging into the double submission, but at least it is uploading the file.
Thanks again,
Ed -
How to pass XML tags in a soapbody parameter having datatype as string?
Hi,
I need to pass XML tags as a String parameter in SOAP:Body.
When I tried send SOAP Request, The SOAP Request was changing < to <
and > to > respectively. Is there any way to ensure that the XML tags (< and >) remain as it is without getting changed.
I also tried to retrieve XML file and stored in a StringBuffer and tried to send SOAP Request but i am still receiving the < and > tags in my SOAP Request.
Pl suggest some alternatives to avoid storing the XML in the form of string and instead directly store the XML into a XML Node so that i can avoid the above condition
Thanks in advance,
gnsinhydHi,
The sample code I used is as follows:
package somepackage;
import javax.mail.internet
import javax.xml.messaging.*;
import javax.xml.soap.*;
import javax.xml.transform.*;
import javax.activation.*;
public class SomeClassName{
// Some namespace declarations
public static void main(String[] args) throws someExceptions{
try
// Create the connection
SOAPConnectionFactory connectionFactory = SOAPConnectionFactory.newInstance();
SOAPConnection connection = connectionFactory.createConnection();
// create a new SOAP message using SAAJ API�s
MessageFactory messageFactory = MessageFactory.newInstance();
SOAPMessage request = messageFactory.createMessage();
// Create a SoapAction header
MimeHeaders headers = request.getMimeHeaders();
headers.addHeader("SOAPAction", "soapaction url");
// Object for SOAP Message parts
SOAPPart part = request.getSOAPPart();
SOAPEnvelope envelope = part.getEnvelope();
envelope.addNamespaceDeclaration("xsd","http://www.w3.org/2001/XMLSchema");
envelope.addNamespaceDeclaration("xsi","http://www.w3.org/2001/XMLSchema-instance");
//envelope.addNamespaceDeclaration("enc","http://schemas.xmlsoap.org/soap/encoding/");
envelope.addNamespaceDeclaration("soap","http://schemas.xmlsoap.org/soap/envelop/");
//envelope.setEncodingStyle("http://schemas.xmlsoap.org/soap/encoding/");
SOAPBody body = envelope.getBody();
SOAPHeader header = envelope.getHeader();
// Now, build the ClaimStorage element in the body for our request
Name somename = envelope.createName("somename");
// � and configure it with the specifics of our request
SOAPElement ClaimStorage = body.addTextNode("somename");
ClaimStorage.addNamespaceDeclaration("xmlns","url");
ClaimStorage.addChildElement(somename).addTextNode("somename");
ClaimStorage.addChildElement(xmlclaim).addTextNode("<XMLTAGS">); <---THE PROBLEM IS HERE
----> THE XML TAGS < > ARE CHANGING TO < AND > MOST PROBABLY DUE TO POST I THINK.
// Save Message
request.saveChanges();
// View SOAP Request
System.out.println("\n Soap Request:\n");
request.writeTo(System.out);
System.out.println();
// Now, create a connection to the HTTP SOAP endpoint
URLEndpoint endpoint = new URLEndpoint("url.asmx");
// Send request, view response. In a real program, we�d process the response envelope programmatically to see if there was a fault, etc.
System.out.println("request =\n" + request);
SOAPMessage response = connection.call(request, endpoint);
// View the output
System.out.println("\nXML Response\n");
// Create Transformer
TransformerFactory tff = TransformerFactory.newInstance();
Transformer tf = tff.newTransformer();
// Get reply content
Source sc = response.getSOAPPart().getContent();
System.out.println("SOAP Body" + response.getSOAPBody());
// Set output transformation
StreamResult result = new StreamResult(System.out);
tf.transform(sc, result);
System.out.println();
// Close connection
connection.close();
System.out.println("\nResponse =\n" + response);
catch (Exception e)
e.printStackTrace();
Pl. reply as soon as possible
Thanks in advance -
How to get XML tag attribute vaue in Oracle
Hi,
I have XML file which have order tag
<submitOrderRes>:Application Exception: SOS</submitOrderRes>.
From this xml file i want to display only the tag value , which is 'Application Exception: SOS'.
how to get this tag value by select SQL
any help is appreciate
TYI don't know your query
Here is the example
SQL> l
1 select
2 extractvalue(xmltype(dbms_xmlgen.getxml('select * from emp where rownum=1'))
3 ,'/ROWSET/ROW/ENAME') col_value
4* from dual
SQL> /
COL_VALUE
SMITHSS -
How to Read XML tags....
Hi guys...
Can any one here tell me how to read the XML tag in PL/SQL.
In table Enquiry there are following fields.
Id number
Status varchar2(5)
Request XML
Reply XML
Error varchar2(10)
Now the following XML will be in request column from the requester.
I have to get the,
->request which is in BODY tag,
->ID number which is in from tag (its the persons unique ID to check his BILL)
Fetch the request from the database and updates it into the REPLY field with the same syntax.
<message>
<to> 123 </to>
<from>789</from>
<body> unbill </body>
<messagenumber> 01 </messagenumber>
</message>
Can any one have the solution to this, how can I read the XML tags, process & again inserts as an XML.
Thanks.Maybe something like this will be a pointer...
SQL> CREATE TABLE t AS
2 select 1 as id, 'C' as status, XMLTYPE('<message><to>123</to><from>789</from><body>unbill</body><messagenumber>01</messagenumber></message>') as request, XMLTYPE('<reply/>') as reply, 'NO ERROR' as error from dual
3 ;
Table created.
SQL>
SQL> SELECT * from t;
ID S
REQUEST
REPLY
ERROR
1 C
<message><to>123</to><from>789</from><body>unbill</body><messagenumber>01</messagenumber></message>
<reply/>
NO ERROR
SQL>
SQL> UPDATE t
2 SET reply = updateXML(request,'/message/body/text()','bill')
3 ;
1 row updated.
SQL>
SQL> SELECT * from t;
ID S
REQUEST
REPLY
ERROR
1 C
<message><to>123</to><from>789</from><body>unbill</body><messagenumber>01</messagenumber></message>
<message><to>123</to><from>789</from><body>bill</body><messagenumber>01</messagenumber></message>
NO ERROR
SQL> -
on release function i am inserting this value
"(&-box*&", "&*box-&
" in to my text box,
in text box will display like this (squarebox), when i am
trying to delete
squarebox ,
box deleting but
(&-box*&", "&*box-&
these xml elements are showing , what i have to
do ? it has to delete,
it amy have multipule box in my equation. how do delete xml
elements in this case, this is my xml code. how to delete? any one
can help me?Then you should provide more details on what you want this new script should do.
To "delete XML tags in already tagged text", all you need is use the "untag" command on an XML Element. But how would the script "know" what XML Element should be untagged?
Disclaimer: This reply is in no way enforceable, legally binding, a promise or contract, an agreement (written, verbal, or otherwise), a commitment, obligation, or free or paid-for offer of any kind to further help, guide, aid, tip, or not hinder you, or contribute to, correct, investigate, comment on or assist with any existing, forthcoming, or planned project. -
How to delete XML Tags in already tagged text?
Hi everyone,
I looked in all the topics but with no results.
Is there anyone that can help me with this script?
Thanks
IvanThen you should provide more details on what you want this new script should do.
To "delete XML tags in already tagged text", all you need is use the "untag" command on an XML Element. But how would the script "know" what XML Element should be untagged?
Disclaimer: This reply is in no way enforceable, legally binding, a promise or contract, an agreement (written, verbal, or otherwise), a commitment, obligation, or free or paid-for offer of any kind to further help, guide, aid, tip, or not hinder you, or contribute to, correct, investigate, comment on or assist with any existing, forthcoming, or planned project. -
How to extract xml tag name contains dashes
Hi, How to parse XML file to extract root tag contains dashes in Flex,for example
XML Input is: <regular-body>Text of my post...</regular-body>
expected output is : regular-body
I appreciate any of your suggestions or inputsDo you want to get the name of the XML ELEMENT regular-body, or the value in the XML file "Text of my post...".
If its the latter, then you could use the bracket/quote notation for extracting the value, like in the following example:
image = xmlWeather[0]..parameters["conditions-icon"]["icon-link"][idx]
I use this when parsing weather information from a 3rd party in which their XML is loaded with dashes.
If you are looking to get the actual element name, not sure how to do that. I would think that if you are using an XML file, you would have at least the high level element known. -
How to set xml tag to nothing in indesign using applescript?
Hi guys,
I need set xml tag to nothing(for tables) in indesign using applescript.
Please help me.Hi,
tell application "Adobe InDesign CC 2014"
tell active document
if (count of story) > 0 then
tell story 1
if (count of tables) > 0 then
tell table 1
set tag_name to associated XML element ----------------> i can't get xml tag, i am receiving the xml tag is nothing.
if (tag_name = nothing) then
display dialog ("This table has no tag")
else
set markup_tag to markup tag of tag_name
set n to name of markup_tag
display dialog ("Tag name is " & n)
end if
end tell
end if
end tell
end if
end tell
end tell
I can't get xml tag for table, i am received nothing -
How to reveal XML tags in InDesign CS5.5?
I'm trying to tag a business catalog for an XML export. I've never done it before - but our sister company has done the same task with a similar catalog. I can view their catalog in InDesign CS5.5 for Windows over a VPN connection in order to see how they tagged their catalog.
I'm doing this task on a Mac using InDesign CS4. The interfaces are not the same. The biggest problem is the sister company is in Czech and so is InDesign. I need to open the tags pane. On the Mac, its just "Window>>Tags." There is a "Window" (Okna) menu, but I'm not seeing a "Tags" choice. I have the structure open, but I want to see all the little colored tags. How do I reveal these on the Windows CS5.5 version?
ThanksWouldn't it be View > Structure > ... ?
-
How to read XML tags in a file, one at a time?
My file format is:
<main>
<section>
(many tags, some including CDATA)
</section>
<section>
(many tags, some including CDATA)
</section>
many more <section>s (over a million)
</main>
To avoid reading all the <section>s into memory, how can I read one <section> at a time?
Thanks in advance.sunmhe wrote:
To avoid reading all the <section>s into memory, how can I read one <section> at a time?If you really want to process huge XML's; you can use SAX or STAX API. -
How to parse XML tag value having '&' character.
Hi,
I have one XML for which value contains '&'. So when I am trying to get the value of that tag from a PL/SQL package its throuwing error as follows:
XML Parse Error: [line 35:col 38] - The reference to entity "SO" must end with the ';' delimiter.
XML :
[b]<LOCCODE>GECORP,Albany1,CP&SO</LOCCODE>
Please let me know how could i handle this '&'.
Thanks
Debashreehint: How is it handeld in html? (check www.w3cschools.com)
-
How remove an XML tag and its childs?
Hi all,
I'm a newbie with XML library. I would like to remove a specific tag and all its childs from an XML document.
I've modified an example VI but Error -2607 is generated (see attachment).
Thanks in advance
Attachments:
xmlTest.jpg 167 KBPost your code and not a picture about it.
Maybe you are looking for
-
Error in undeployment the Ear File in oracle 10g Application server
Hii while undeploying EAR in Oracle Enterprise Manager 10g. I am getting following error message and an resoluation message,which i could not able to proceed further An error occured while undeploying the application.Base Exception : Another operatio
-
Can't Add Zone To DNS - + Button Doesn't Work
Hi, Running 10.4 Server and I can't add a zone. The + button doesn't bring up a dialog like it is supposed to... Is there a fix for this? Did I miss a step somewhere? Thanks in advance!
-
Report error: ORA-02020: too many database links in use
I am getting error ORA-02020 in a report that works exactly the same in other APEX instance. The query refers several tables from Oracle Financials with a single database link. The weird thing is that for some parameters the report shows the expected
-
Careful everyone! The screen on the 5th generation 'scratches' easily!!!! Cover the screen, right away!!! p.s.: I have 4 ipods. (see below)
-
Missing Result Rows on Query with Conditions
I have a query that has a condition to show only items over $2500.00. We have a result row that shows for plant when the condtions is not on but once the condition is set that result row goes away. Does anyone know how to get a result row to show