XML Pagemap attributes
I have been trying to find all the different attributes that can be used in a pagemap but cannot find them using a search engine, anyone know where I can find them please?
I have simular problems with xml documents. Added a extra taglibrary with separate code coloring and sometimes it shows up, sometimes it don't. And after some editing it will appear, but not on all tags. Apart from that, sometimes attributes will show in a list, sometimes they don't.
Think that something is not right in CS4 (on windows xp sp3).
Grtz
Similar Messages
-
Pixel-Positions in XML-Element attributes
hi,
is there a way, when attaching a xml-tag to e.g. a picture, that the top and left pixel value is saved in a xml-element attribute? the pixel value from top and from the left.
thanks in advance.
regards.hi,
is there a way, when attaching a xml-tag to e.g. a picture, that the top and left pixel value is saved in a xml-element attribute? the pixel value from top and from the left.
thanks in advance.
regards. -
XMLTABLE function not returning any values if xml has attribute "xmlns"
Hi,
XMLTABLE function not returning any values if xml has attribute "xmlns". Is there way to get the values if xml has attribute as "xmlns".
create table xmltest (id number(2), xml xmltype);
insert into xmltest values(1,
'<?xml version="1.0"?>
<emps>
<emp empno="1" deptno="10" ename="John" salary="21000"/>
<emp empno="2" deptno="10" ename="Jack" salary="310000"/>
<emp empno="3" deptno="20" ename="Jill" salary="100001"/>
</emps>');
insert into xmltest values(2,
'<?xml version="1.0"?>
<emps xmlns="http://emp.com">
<emp empno="1" deptno="10" ename="John" salary="21000"/>
<emp empno="2" deptno="10" ename="Jack" salary="310000"/>
<emp empno="3" deptno="20" ename="Jill" salary="100001"/>
</emps>');
commit;
SELECT a.*
FROM xmltest,
XMLTABLE (
'for $i in /emps/emp
return $i'
PASSING xml
COLUMNS empno NUMBER (2) PATH '@empno',
deptno NUMBER (3) PATH '@deptno',
ename VARCHAR2 (10) PATH '@ename',
salary NUMBER (10) PATH '@salary') a
WHERE id = 1;
The above query returning results but below query is not returning any results because of xmlns attribute.
SELECT a.*
FROM xmltest,
XMLTABLE (
'for $i in /emps/emp
return $i'
PASSING xml
COLUMNS empno NUMBER (2) PATH '@empno',
deptno NUMBER (3) PATH '@deptno',
ename VARCHAR2 (10) PATH '@ename',
salary NUMBER (10) PATH '@salary') a
WHERE id = 1;
how to get rid out of this problem.
Thanks,
-ManiAdded below one in xmltable, its working now.
XmlNamespaces(DEFAULT 'http://emp.com') -
Hello
I've got a table XYZ with the fields ABC and DEF. I want Oracle XE database to give me the following XML back:
<ROWSET>
<ROW ABC="..." DEF="..."/>
<ROW ABC="..." DEF="..."/>
</ROWSET>
the fields as attributes. I know only how to get XML with elements but I need xml attributes. Does anybody know how this works with ODP.NET? I use the XmlCommandType property, r=ExecuteXmlReader() function and "doc.load(r)". In the past I got XML with attributes using Oracle9i R2, OO4O and MS Visual Basic 6. I set a property for each column.
Regards
Marcus Warm
(Germany)
[Oracle 10g Express Edition R2, Visual Studio 2005 VB, ADO.NET 2.0, Windows
XP]
<<also posted in de.comp.datenbanken.misc>>Hi
In this case you have to change your Source structure and map the attrbute values to target and in receiver channel you can perform your content conversion.
Regards
Ramg
Edited by: Ramkumar Ganesh on Apr 28, 2010 11:09 PM -
IDOC to File, variable substitution on outbound message XML tag attributes
My scenario is IDOC to FILE using XSL mappings.The target format is 2 XML tags (header, line) with the data stored in the attributes of each tag.
EG. <header attr1=one attr2=two attr3=three><line attr1=one attr2=two /></header>
The name of the file is dictated by an outbound attribute value in the header tag.
Can I get access to it the attribute in the target message in the CC_FILE using variable substution. ?
Currently I am not using content conversion as the XSL produces the file format needed, so I would pefer not to change the outbound message format/structure as this is going to an external party. I would prefer not to change the outbound format as this would need content conversion to strip the unwanted/information/processing node that is used for this purpose (file naming).
The name is a calculation of fields in the IDOC and is not explicit dictated (business logic is applied in the mapping to get the file name), so I would prefer to use the attribute of the resulting XML to keep the "business logic" in the XSL..
Things that cannot be changed.... 1. Must use XSL.for mapping. 2. Format cannot be changed of the outbound message. 3. Would prefer not to involved content conversion to keep formatting/node structure in the XSL mapping.
I have seen some reference to this being possible on the forums but nothing solid from what Ive read.
Something like var1 = payload:/Header/@attr1 in variable sub to get at the attribute
Any comments ?
Thanks in advance.
One final piece of info. its on a PI 7.1 system.I think its best explained by my other thread Link:PI 7.1 Access to Dynamic Configuration through Java Class .
Thanks for the link I have already implemented based on that link but the one crucial difference is that it is implemented using a static method with no reference to the actual object (payload) for Dynamic configuration. It seems that without the 7.0 API which isnt available in 7.1 by default XSL with java extentions is limited to static methods. If you could read the other thread it certainly is possible I'm mistaken. -
WebService response object in XML - parsing attributes
Hi- new to Flex and I'm trying to parse out the attributes of the response object. I can get the entire object and see that its working, but I cant get just a single attribute. It pulls weather info for world cities. For example, I just want the location name and temperature.
Any advice on this? Thanks!
<?xml version="1.0"?>
<!-- fds\rpc\RPCResultFaultMXML.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:s="library://ns.adobe.com/flex/spark">
<mx:Script>
<![CDATA[
import mx.rpc.soap.SOAPFault;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import mx.controls.Alert;
import mx.utils.ObjectUtil;
public function showErrorDialog(event:FaultEvent):void {
// Handle operation fault.
Alert.show(event.fault.faultString, "Error");
public function defaultFault(event:FaultEvent):void {
// Handle service fault.
if (event.fault is SOAPFault) {
var fault:SOAPFault=event.fault as SOAPFault;
var faultElement:XML=fault.element;
// You could use E4X to traverse the raw fault element returned in the SOAP envelope.
Alert.show(event.fault.faultString, "Error");
public function log(event:ResultEvent):void {
// Handle result.
trace(event.result);
//trace(ObjectUtil.toString(event.result));
//var len:int;
//len = event.result.length;
//trace(len);
//trace(event.result);
//trace(event.result.GetWeatherResponse.Location);
//var myXML:XML = new XML(event.result);
//trace(myXML.attribute("Location"));
]]>
</mx:Script>
<mx:WebService id="WeatherService" wsdl="http://www.webservicex.com/globalweather.asmx?wsdl"
fault="defaultFault(event)">
<mx:operation name="GetWeather"
fault="showErrorDialog(event)"
result="log(event)"
resultFormat="xml">
<mx:request>
<CityName>{myCity.text}</CityName>
<CountryName>{myCountry.text}</CountryName>
</mx:request>
</mx:operation>
</mx:WebService>
<mx:TextInput id="myCity" text="Madrid"/>
<mx:TextInput id="myCountry" text="Spain"/>
<!-- Call the web service operation with a Button click. -->
<mx:Button width="60" label="Get Weather"
click="WeatherService.GetWeather.send();"/>
<!-- Display the Weather -->
<mx:Label text="Weather:"/>
<mx:TextArea text="{WeatherService.GetWeather.lastResult}" height="200"/>
</mx:Application>The WSDL says GetWeatherResponse is a string, and it appears to be a string of XML, so set <mx:operation resultFormat="object"> as this will unwrap the SOAP response value and leave a string typed value intact. You can then create a new ActionScript 3.0 E4X-based XML instance from the unwrapped string:
var myXML:XML = new XML(event.result.toString());
You can then travese the XML document using E4X syntax, a simple example is included below:
trace(myXML..Location);
trace(myXML..Temperature); -
I am writing java through lotus notes. In it I go out and hit a web service and return the xml data. Once in the xml I use a transformer but I get the following error:
javax.xml.transform.TransformerException: stylesheet requires attribute: version
The code that I have does work when I use my xml as a file instead of in from the web service. I can not find anything that makes tis work. Before I had written this in lotusscript and used the ls2j connector and it worked fine (until the JVM would blow up) so we are dropping the connector and writing it all in java. Here is my code to work with the transformer....
import java.io.StringReader;
import java.io.StringWriter;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import org.apache.xalan.processor.*;
import javax.xml.parsers.*;
import javax.xml.transform.dom.*;
import org.w3c.dom.*;
* This class allows you to apply an XSL style sheet against an XML string from within the Lotus Notes environment, without having to place an XSL file on the file system or use a Java Agent.
* Xalan-Java 2.5.0 is required. It can be downloaded from http://xml.apache.org/xalan-j/ .
* The JavaUserClasses variable in the Lotus Notes notes.ini file must reflect the jar files from Xalan.
public class clsNotesXSLTNTS extends Object
private String strXml;
private String strXsl;
private String strXslUrl;
* Empty Constructor.
* @see java.lang.Object#Object()
public clsNotesXSLTNTS ()
super();
* This method will return the resultant transformation.
* A url is the default source for the xsl file which is set using setXslUrl(). If it is not found a String input is assumed which is set using setXsl().
* If a xsl url or a xsl String is not provided, null will be returned.
* @return String
public String process() {
try
StringReader srXSL;
StringReader srXML = new StringReader(strXml);
StringWriter sw = new StringWriter();
StreamSource ssXSL;
TransformerFactory factory = null;
Transformer transformer = null;
// determine the source xsl type
if (this.strXslUrl != null) {
ssXSL = new StreamSource(this.strXslUrl);
else if (this.strXsl != null) {
srXSL = new StringReader(strXsl);
ssXSL = new StreamSource(srXSL);
else {
return null;
// set the sax driver
// System.setProperty("org.xml.sax.driver", "org.apache.xerces.parsers.SAXParser");
try {
// create a new factory
transformer = factory.newTransformer(ssXSL);
catch(Exception e) {
System.out.println("Unable to create Transformer Factory: " + e.getMessage());
try {
// create a new transformer
transformer = factory.newTransformer(ssXSL);
catch(Exception e) {
System.out.println("Unable to create Transformer:" + e.getMessage());
// get the source xml
StreamSource xmlsource = new StreamSource(srXML);
// create a stream for the result of the transformation
StreamResult output = new StreamResult(sw);
// transform the input xml using the input xsl
transformer.transform(xmlsource, output);
// return the resultant transformation
return sw.toString();
// return strXml;
catch(Exception e)
e.printStackTrace();
// System.out.println(strXml);
return null;
* Gets the XML string that is to be transformed.
* @return String
public String getXml() {
return strXml;
* Sets the XML string that is to be transformed.
* @param pstrXml The XML string.
public void setXml(String pstrXml) {
this.strXml = pstrXml;
* Gets the XSL string that is used to transform the XML string.
* @return String
public String getXsl() {
return strXsl;
* Sets the XSL string that is used to transform the XML string.
* @param pstrXsl The XSL string.
public void setXsl(String pstrXsl) {
this.strXsl = pstrXsl;
* Gets the URL of the XSL file that is used to transform the XML string.
* @return String
public String getXslUrl() {
return strXslUrl;
* Sets the URL of hte XSL file that is used to transform the XML string.
* @param pstrXslUrl The URL of the XSL file.
public void setXslUrl(String strXslUrl) {
this.strXslUrl = strXslUrl;
}to set the XML I use the following code:
clsNotesXSLTNTS JXSLT;
JXSLT = new clsNotesXSLTNTS();
JXSLT.setXslUrl(strXSLPath);
JXSLT.setXml(XMLData);
XMLData = JXSLT.process();where the XMLData is returned from the web services, here is an example file that I printed out to the browser and saved. If I use this file it works, but if I do not put it out to the file system then it does not work.
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<getInfoByPartialNameSpmpy004Response xmlns="http://tempuri.org/"><getInfoByPartialNameSpmpy004Result>
<params xmlns="http://tempuri.org/"><baseTarget>MainFrame</baseTarget><onLoadFunction>PostLoad()</onLoadFunction><formName>InquirySelection</formName><filePath>C:/notes/data/aptestCOPY.nsf</filePath><isUser>1</isUser><isNewForm>0</isNewForm><searchVendors>1</searchVendors><vendorSearchString>SHER</vendorSearchString><printVendorSelection>1</printVendorSelection><tableBGColor>#FFFEAD</tableBGColor><THClass>normal</THClass><TDClass>normal</TDClass></params><anyType xsi:type="clsVendorInfo"><blnFound>true</blnFound><strNumber>4603232 </strNumber><strName>HOTEL Name </strName><strAddr1>18TH AT Smoothie ST </strAddr1><strAddr2> </strAddr2><strCity>Somewhere </strCity><strState>PA </strState></anyType></getInfoByPartialNameSpmpy004Result></getInfoByPartialNameSpmpy004Response></soap:Body></soap:Envelope>This file was generated by calling the web service with the program and then printing it out to the browser and cut and paste. Anyone with any thoughts ????
Thanks in advanceI left off the first part of my XSL...
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ap="http://tempuri.org/" version = "1.0">
<xsl:strip-space elements="*" />
<xsl:output method="html" encoding="utf-8"/> -
XML Parsing attributes with encoded ampersand causes wrong order
Hi all,
I am writing in the forum first (because it could be that i am doing something wrong.... but i think it is a bug. Nonetheless, i thought i'd write my problem up here first.
I am using Java 6, and this has been reproduced on both windows and linux.
java version "1.6.0_03"
Problem:
read XML file into org.w3c.dom.Document.
XML File has some attributes which contain ampersand. These are escaped as (i think) is prescribed by the rule of XML. For example:
<?xml version="1.0" encoding="UTF-8"?>
<lang>
<text dna="8233" ro="chisturi de plex coroid (>=1.5 mm)" it="Cisti del plesso corioideo(>=1.5mm)" tr="Koroıd pleksus kisti (>=1.5 mm)" pt_br="Cisto do plexo coróide (>=1,5 mm)" de="Choroidplexus Zyste (>=1,5 mm)" el="Κύστεις χοροειδούς πλέγματος (>= 1.5 mm)" zh_cn="脉络膜囊肿(>= 1.5 mm)" pt="Quisto do plexo coroideu (>=1,5 mm)" bg="Киста на хориоидния плексус (>= 1.5 mm)" fr="Kystes du plexus choroide (>= 1,5 mm)" en="Choroid plexus cysts (>=1.5 mm)" ru="кисты сосудистых сплетений (>=1.5 mm)" es="Quiste del plexo coroideo (>=1.5 mm)" ja="脈絡膜嚢胞(>=1.5mm)" nl="Plexus choroidus cyste (>= 1,5 mm)" />
</lang>As you might understand, we need to have the fixed text '>' for later processing. (not the greater than symbol '>' but the escaped version of it).
Therefore, I escape the ampersand (encode?) and leave the rest of the text as is. And so my > becomes >
All ok?
Symptom:
in fetching attributes, for example by the getAttribute("en") type call, the wrong attribute values are fetched.
Not only that, if i only read to Document instance, and write back to file, the attributes are shown mixed up.
eg:
dna: 8233, ro=chisturi de plex coroid (>=1.5 mm), en=кисты сосудистых сплетений (>=1, de=Choroidplexus Zyste (>=1,5 mm)Here you can see that 'en' is shown holding what looks like greek, ... (what is ru as a country-code anyway?) where it should have obviously had the english text that originally was associated with the attribute 'en'
This seems very strange and unexpected to me. I would have thought that in escaping (encoding) the ampersand, i have fulfilled all requirements of me, and that should be that.
There is also no error that seems to occur.... we simply get the wrong order when fetching attributes.
Am I doing something wrong? Or is this a bug that should be submitted?
Kind Regards, and thanks to all responders/readers.
Sean
p.s. previously I had not been escaping the ampersand. This meant that I lost my ampersand in fetching attributes, AND the attribute order was ALSO WRONG!
In fact, the wrong order was what led me to read about how to correctly encode ampersand at all. I had been hoping that correctly encoding would fix the order problem, but it didn't.
Edited by: svaens on Mar 31, 2008 6:21 AMHi kdgregory ,
Firstly, sorry if there has been a misunderstanding on my part. If i did not reply to the question you raised, I appologise.
In this 'reply' I hope not to risk further misunderstanding, and have simply given the most basic example which will cause the problem I am talking about, as well as short instructions on what XML to remove to make the problem disappear.
Secondly, as this page seems to be displayed in ISO 8859-1, this is the reason the xml I have posted looks garbled. The xml is UTF-8. I have provided a link to the example xml file for the sample below
[example xml file UTF-8|http://sean.freeshell.org/java/less2.xml]
As for your most recent questions:
Is it specified as an entity? To my knowledge (so far as my understanding of what an entity is) , yes, I am including entities in my xml. In my below example, the entities are the code for the greater than symbol. I am under the understanding that this is allowed in XML ??
Is it an actual literal character (0xA0)? No, I am specifying 'greater than' entity (code?) in order to include the actual symbol in the end result. I am encoding it in form 'ampersand', 'g character', 't character', 'colon' in order for it to work, according to information I have read on various web pages. A quick google search will show you where I got such information from, example website: https://studio.tellme.com/general/xmlprimer.html
Here is my sample program. It is longer than the one you kindly provided only because it prints out all attributes of the element it looks for. To use it, only change the name of the file it loads.
I have given the xml code seperately so it can be easily copied and saved to file.
Results you can expect from running this small test example?
1. a mixed up list of attributes where attribute node name no longer matches its assigned attribute values (not for all attributes, but some).
2. removing the attribute bg from the 'text' element will reduce most of these symptoms, but not all. Removing another attribute from the element will most likely make the end result look normal again.
3. No exception is thrown by the presence of non xml characters.
IMPORTANT!!! I have only just (unfortunately) noticed what this page does to my unicode characters... all the the international characters get turned into funny codes when previewed and viewed on this page.
Whereas the only codes I am explicitly including in this XML is the greater than symbol. The rest were international characters.
Perhaps that is the problem?
Perhaps there is an international characters problem?
I am quite sure that these characters are all UTF-8 because when I open up this xml file in firefox, It displays correctly, and in checking the character encoding, firefox reports UTF-8.
In order to provide an un-garbled xml file, I will provide it at this link:
link to xml file: [http://sean.freeshell.org/java/less2.xml]
Again, sorry for any hassle and/or delay with my reply, or poor reply. I did not mean to waste anyones time.
It will be appreciated however if an answer can be found for this problem. Chiefly,
1. Is this a bug?
2. Is the XML correct? (if not, then all those websites i've been reading are giving false information? )
Kindest Regards,
Sean
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
public class Example
public static void main(String[] argv)
try
FileInputStream fis = new FileInputStream("/home/sean/Desktop/chris/less2.xml");
Document doc = DocumentBuilderFactory.newInstance()
.newDocumentBuilder()
.parse(new InputSource(fis));
Element root = doc.getDocumentElement();
NodeList textnodes = root.getElementsByTagName("text");
int len = textnodes.getLength();
int index = 0;
int attindex = 0;
int attrlen = 0;
NamedNodeMap attrs = null;
while (index<len)
Element te = (Element)textnodes.item(index);
attrs = te.getAttributes();
attrlen = attrs.getLength();
attindex = 0;
Node node = null;
while (attindex<attrlen)
node = attrs.item(attindex);
System.out.println("attr: "+node.getNodeName()+ " is shown holding value: " + node.getNodeValue());
attindex++;
index++;
System.out.println("-------------");
fis.close();
catch(Exception e)
System.out.println("we've had an exception, type "+ e);
} [example xml file|http://sean.freeshell.org/java/less2.xml]
FOR THE XML, Please see link above, as it is UTF-8, and this page is not. Edited by: svaens on Apr 7, 2008 7:03 AM
Edited by: svaens on Apr 7, 2008 7:23 AM
Edited by: svaens on Apr 7, 2008 7:37 AM
Edited by: svaens on Apr 7, 2008 7:41 AM -
XML with attributes 2 CSV with file adapter
Hi,
I have used this [link|http://help.sap.com/saphelp_nw04/Helpdata/EN/24/4cad3baabd4737bab64d0201bc0c6c/content.htm] to convert a xml file to a csv file. That works fine so far as long as my source file is like this:
<root>
<tag>
<element1>
<element2>
</tag>
</root>
But what can I do if I have it like this?
<root>
<tag element1="something" element2="nothing" ...>
</tag>
</root>
With my current settings in my file receiver channel the attributes in this example element1, element2 are not being postet in the csv file and I have no idea how to do this. The link from above does not mention anything like this. Is it possible, at all?
Best regards.
Oliver.Hi
In this case you have to change your Source structure and map the attrbute values to target and in receiver channel you can perform your content conversion.
Regards
Ramg
Edited by: Ramkumar Ganesh on Apr 28, 2010 11:09 PM -
Creating RosettaNet data types in XI 2.0: 'xml:lang' attribute
Has anybody successfully created a RosettaNet interface in XI 2.0?
I am working with the PIP 3A2 messages, but some of the elements have an attribute named 'xml:lang', which is a standardized attribute from the W3C's XML namespace. The attribute name is declared as 'xml:lang' because it's still a DTD-based PIP. Normally, in schema, this is handled by declaring an import of the xml.xsd file provided by W3C and defining the namespace alias 'xml' to point to it in the RosettaNet schema. The xml.xsd provided by W3C boils down to the following declaration, to support 'xml:lang' as an attribute...
<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="en">
<xs:attribute name="lang" type="xs:language">
</xs:attribute>
</xs:schema>
I'm trying to create this interface in the XI 2.0 data type editor, but...
1. I can't create attributes as standalone data types in alternate namespaces (to simulate the declarations in W3C's xml.xsd).
2. I can't link a standalone attribute declaration from another namespace to an attribute in the editor.
3. The editor prohibits use of a colon in the attribute name (as it should), so I can't declare the attribute name to be 'xml:lang'.
4. I can't figure out how to control the addition of a new namespace alias to 'xml'. The editor wants to use default names like 'p0' when I bring in types from other namespaces.
Can anyone suggest where I should look for an answer?
--Dan King
CapgeminiHi Dan,
You can design and Test Rosettanet PIPS Messages in XI-3.0 only.
Regards
Prasad
SAP Netwaver RIG-XI
SAP Labs LLC, USA -
XML element attributes in program
I am using following FMs to create XML document from internal table
CALL FUNCTION 'SDIXML_DATA_TO_DOM'
CALL FUNCTION 'SDIXML_DOM_TO_XML'
My internal table has field 'AMT' and generated XML file has following line
<AMT>1000</AMT>
But I want this line to be generated as <AMT Ccy = 'USD'>1000</AMT>
I tried to use set_attribute method of element but not able to get this.I should be missing somethig as I am new to this XML.
Can anyone please advsie how I can get this?
Thanks for your help.
SrinivasHello Srinivas
Below you see sample coding that I use on SAP-PI to map attributes into the XML stream (INVOIC IDoc)::
NOTE: mo_document is of TYPE REF TO if_ixml_document (which is exported as DATA_AS_DOM by fm SDIXML_DATA_TO_DOM).
METHOD MAP_SD_DOC_CAT_AND_BILL_TYPE.
* define local data
DATA: ld_billingdoc TYPE bapivbrkout-billingdoc,
ld_billing_type type bapivbrkout-bill_type,
ld_sd_doc_category TYPE vbtyp,
ld_edi_qualifier TYPE string.
" Location code mapping only for outbound invoices, i.e.
" invoices sent by subsidiary to its customers
CHECK ( is_outbound_invoic( ) = abap_true ).
CALL METHOD zcl_edi_idoc_invoic_services=>get_billingdoc_detail
EXPORTING
param = mif_param
* id_idocnumber =
id_rfc_destination = md_rfcdest
IMPORTING
ed_billingdoc = ld_billingdoc
ed_billing_type = ld_billing_type
ed_sd_doc_category = ld_sd_doc_category
ed_edi_qualifier = ld_edi_qualifier.
* NOTE: We add the SD document category and the EDI qualifier
* as attributes to E1EDK01/BELNR.
** <E1EDK01 SEGMENT="1">
** <CURCY>EUR</CURCY>
** <HWAER>EUR</HWAER>
** <WKURS>1.00000</WKURS>
** <ZTERM>T60F</ZTERM>
** <EIGENUINR>nnn</EIGENUINR>
** <BSART>INVO</BSART>
** <BELNR SD_DOC_CATEGORY="O" EDI_QUALIFIER="381" BILL_TYPE="ZOII">
** 1010010911
** </BELNR>
** <NTGEW>97.662</NTGEW>
** <BRGEW>127.239</BRGEW>
** <GEWEI>KGM</GEWEI>
** <FKART_RL>LR</FKART_RL>
** <RECIPNT_NO>0000823305</RECIPNT_NO>
** <FKTYP>L</FKTYP>
** </E1EDK01>
DATA: ld_name TYPE string,
ld_value TYPE string,
ld_rc TYPE i,
lo_node TYPE REF TO if_ixml_node,
lo_node_child TYPE REF TO if_ixml_node,
lo_clone TYPE REF TO if_ixml_node,
lo_children TYPE REF TO if_ixml_node_list,
lo_element TYPE REF TO if_ixml_element,
lo_attribute TYPE REF TO if_ixml_attribute,
lo_filter TYPE REF TO if_ixml_node_filter,
lo_iter TYPE REF TO if_ixml_node_iterator,
lo_doc TYPE REF TO if_ixml_document.
* Filter for nodes of segment E1EDK01
lo_filter = mo_document->create_filter_name( name = 'E1EDK01' ).
CALL METHOD mo_document->create_iterator_filtered
EXPORTING
* depth = 0
filter = lo_filter
RECEIVING
rval = lo_iter.
DO.
lo_node = lo_iter->get_next( ).
EXIT.
ENDDO.
* NODE: First (and single) parent node is the entire E1EDK01 segment
lo_children = lo_node->get_children( ).
lo_filter = mo_document->create_filter_name( name = 'BELNR' ).
lo_iter = lo_children->create_iterator_filtered( lo_filter ).
* NOTE: We should have a single child node => BELNR
DO.
lo_node = lo_iter->get_next( ).
EXIT.
ENDDO.
CHECK ( lo_node IS BOUND ).
ld_name = lo_node->get_name( ).
ld_value = lo_node->get_value( ).
LOG-POINT ID zedi
SUBKEY mc_subkey_runtime
FIELDS syst-index ld_name ld_value.
* Add attribute SD_DOC_CATEGORY and EDI_QUALIFIER to element BELNR
lo_element ?= lo_node.
ld_name = 'SD_DOC_CATEGORY'.
ld_value = ld_sd_doc_category.
CALL METHOD lo_element->set_attribute
EXPORTING
name = ld_name
value = ld_value
RECEIVING
rval = ld_rc.
ld_name = 'EDI_QUALIFIER'.
ld_value = ld_edi_qualifier.
CALL METHOD lo_element->set_attribute
EXPORTING
name = ld_name
value = ld_value
RECEIVING
rval = ld_rc.
ld_name = 'BILL_TYPE'.
ld_value = ld_billing_type.
CALL METHOD lo_element->set_attribute
EXPORTING
name = ld_name
value = ld_value
RECEIVING
rval = ld_rc.
ENDMETHOD.
Regards
Uwe -
How to write XML with attributes to a table in Oracle?
I tried to find solutions over the internet. Some of the stuff I looked at:https://forums.oracle.com/thread/2182669 http://www.club-oracle.com/forums/how-to-insert-data-from-xml-to-table-t2845/
In all these cases, the solution considers XML structure with only nodes and child nodes but not attributes. In fact, one of the solutions suggests transforming the XML into a canonical form with only nodes w/o attributes.
This is a sample of xml structure I am working with:
Sample XML
<rep type="P" title="P List"> <as> <a id="3" /> <a id="4" /> </as> </rep>
I am working with oracle client 11.2 and SQL developer
My question is: how to write XML data into a table with attributes also as column values, beside the nodes?My question is: how to write XML data into a table with attributes also as column values, beside the nodes
The question you should be asking is : "how do I access attributes in the XPath language?"
and the answer to that is easily found in any XPath tutorial you may find over the Internet, it is not related to Oracle in particular.
Short answer : you use an "attribute::" axis before the attribute name, or more commonly a "@", e.g. @type, @id etc.
Using the method described in the first link, something like this will extract the root attributes :
SELECT x.*
FROM XMLTable(
'/rep'
passing <xmltype variable/column goes here>
columns type varchar2(1) path '@type'
, title varchar2(30) path '@title'
) x ;
For deeper levels, use additional XMLTable calls as described in the mentioned post. -
JS: how can find role in XML element attribute
Dear All,
We could gather "footnote" XML elements as an array. But we need to filter the elements which has "role=endnote" in the attributes from the group of common footnote tagged elements .
Eg. <footnote xml:id="en2" label="2" role="endnote"> from myGetXMLElements("//footnote")
Kindly assist to get footnote XML elements which has the role "endnote".
regards
MasthanHi Fred,
Yes, I got it. Thanks
regards
Masthan -
Is it possible to retrieve the value of a certain attribute within a certain tag i a XML document without parsing the entire document ?
// The_IcemanIf you used SAX, you could throw a SAXException when you reached the element in question, thus ending the parse abnormally.
-
Save to XML: image attribute defined twice
Hello all,
I am saving a structured document to XML and run into an error I cannot explain - or solve: I place graphics inside an anchored frame, which is aligned right with the image centered in the frame. Saving the document to XML generates an error in the log, stating that the 'align' attribute is already used in the image element. The XML shows the following:
<figure Language = "en-US">
<image entity = "image5" impsize = "1.289in 1.478in" impby = "ref"
sideways = "0" impang = "0.000" xoffset = "2.111in"
yoffset = "0.000in" position = "below" align = "aright"
cropped = "1" float = "0" width = "5.512in" height = "1.479in"
angle = "0.000" nsoffset = "0.000in" align = "left"/>
Does anyone know where the second align attribute (align = "left") comes from ? The Structure Application Developer Guide clearly states that the 'align' attribute is the frame alignment on the page, so the first align attribute is in fact the correct one.
Thanks for any help - I would hate to ship my stuff to my clients when they get ugly errors on saving to XML.
JangHi again,
Disregard the previous post. I found the mistake: the image that was inserted in the anchored frame had an invalid attribute 'align' - that is where the second attribute came from in the XML. Oh well, I should learn to check all options before shooting off a post on this forum. Sorry for the interruption.
Thanks anyway
Jang
Maybe you are looking for
-
Hi Frnd, While doing Migo transaction i get the following error Posting only possible in periods 2008/01 and 2007/12 in company code . I understood from this that the correct current period date has not been set in the system. I need to some change
-
I have lost my address field in Safari -how can I get it back
I have no address field in Safari any more. Only my home page comes up and I cant write over it to get another web page. Also google search bar disappeared.
-
How do I map a composite foreign key using toplink? I can reference a particular record in mytable using the following sql statement: SELECT * FROM mytable m WHERE m.foreign_id = x AND m.type = y; Where x represents the primary key in my entity and y
-
Change in support network for Postalsoft products?
When we re-upped, we found that SAP is no longer handling it "directly", but through a system of master dealers. We hadn't dealt directly with SAP before, so I am not sure why we needed to add a third layer. As a result, we are getting new S numbers;
-
New GL concepts, Document splitting and how teh system behaves in different
Hi gurus, I need this NEW GL Concepts Thanks Srinivas