Creating XML object with namespaces
I'm trying to create the following XML
<xs:schema id='MySchema' xmlns:xs='
http://www.w3.org/2001/XMLSchema'
xmlns:msdata='urn:schemas-microsoft-com:xml-msdata'>
<xs:element name='MySchema' msdata:IsDataSet='true'
msdata:UseCurrentLocale='true'/>
</xs:schema>
Following the documentation it appears that the following
code should do the trick
private const xs:Namespace = new Namespace("
http://www.w3.org/2001/XMLSchema");
private const msdata:Namespace = new
Namespace("urn:schemas-microsoft-com:xml-msdata");
var testXml:XML = <schema></schema>;
testXml.addNamespace(xs);
testXml.addNamespace(msdata);
testXml.@id = "MySchema";
testXml.xs::element.@name = "MySchema";
testXml.element.@msdata::IsDataSet = true;
testXml.element.@msdata::UseCurrentLocale = true;
However, this results in the following XML
<schema id="PERSONDETAILS">
<element name="PERSONDETAILS" xmlns="
http://www.w3.org/2001/XMLSchema"/>
<element IsDataSet="true" UseCurrentLocale="true"
xmlns="urn:schemas-microsoft-com:xml-msdata"/>
</schema>
Can anyone tell me what I'm doing wrong? Thanks
Got it, this seems to work...
var testXml:XML = <xs:schema xmlns:xs='
http://www.w3.org/2001/XMLSchema'
xmlns:msdata='urn:schemas-microsoft-com:xml-msdata'></xs:schema>;
testXml.@id = "MySchema";
testXml.xs::element.@name = "MySchema";
testXml.element.@msdata::IsDataSet = true;
testXml.element.@msdata::UseCurrentLocale = true;
Similar Messages
-
I want to create a basic XML object in AS3, but don't know
how to do this.
I first tried creating a string that represented my XML
elements and their values, but then I don't know how to convert
this string into an XML object.
Secondly, I believe there are other ways of creating XML
objects in AS without doing anything with strings.
Can somebody please recommend to me a way to do this?
An XML example to create with AS3 is:I've figured out the solution to my problem. For anyone
interested, see me code below (the xml element names are different,
but the concept is the same). -
Selecting XML Children with Namespaces
I am trying to select child nodes of an XML element that have
a different namespace from the parent, but xml.child(name) returns
an empty list.
In the attached code, londonList contains a single XML
element and parisList is empty. I can't figure out how to find the
paris child, and have tried adding the prefix to findParis (so it
is "ff:b") as well as turning findParis into an XML object with the
name "b" and adding the ff namespace to it, then passing that to
child. Neither of those have worked.
Any help is appreciated.Unfortunately in my real scenario I don't know what the
element will be called. It could be in <foo> or <bar>
etc, so I need to be able to use a variable (in which the element
name is set beforehand). With "::" I can't use a variable, so
textXML.ns::findParis looks for a "findParis" element and not "b".
That's why I'm trying to use testXML.child(findParis) because
I can use a variable. I just can't figure out how to make it
incorporate the namespace as well. -
Unstructured Xml Storage with Namespaces - Problem in DML Queries
Hai All,
I worked with xml namespace with registering schema in db and referred in my xml document.It worked fine.
But i want to work in unstructured xml document with namespaces, to do all dml queries like, select,update,delete using Xpath to xmltype.
I could insert the records,When i try to select some element from xmltype field using Xptah from db,it does not bring any thing like element value or any error.It just displaying as empty value.I am using oracle 10g R2.
Please help me how to select the element value from xmltype using XPath or whatever it is.
Please help me out from this to follow
Advance Thanks,
P.SavanananSQL> create user marco identified by marco account unlock;
User created.
SQL> grant dba, xdbadmin to marco;
Grant succeeded.
SQL> conn marco/[email protected]
Connected.
SQL> create table xml_tab ( details xmltype);
Table created.
SQL> insert into xml_tab values(XMLTYPE('<?xml version="1.0" ?>
2 <customers xmlns="http://localhost/openuri.org" >
3 <customer>
4 <order xmlns="http://orcl.com" >
5 <ordername>Computer</ordername>
6 <cost>35785638</cost>
7 </order>
8 </customer>
9 </customers>'));
1 row created.
SQL> commit;
Commit complete.
SQL> select extractValue(details,'/customers/customer/order/ordername') from xml_tab;
EXTRACTVALUE(DETAILS,'/CUSTOMERS/CUSTOMER/ORDER/ORDERNAME')
SQL> set long 10000
SQL> select * from xml_tab;
DETAILS
<?xml version="1.0"?>
<customers xmlns="http://localhost/openuri.org">
<customer>
<order xmlns="http://orcl.com">
<ordername>Computer</ordername>
<cost>35785638</cost>
</order>
</customer>
</customers>
SQL> select extract(details,'//order/ordername') XDATA
2 from xml_tab
3 ;
XDATA
SQL> select extract(details,'//order/ordername','xmlns="http://orcl.com"') XDATA
2 from xml_tab
3 ;
XDATA
<ordername xmlns="http://orcl.com">Computer</ordername>
SQL> select extractValue(details,'//order/ordername','xmlns="http://orcl.com"') XDATA
2 from xml_tab
3 ;
XDATA
Computer
SQL> select extractValue(details,'/*/*/order/ordername','xmlns="http://orcl.com"') XDATA
2 from xml_tab
3 ;
XDATA
Computer -
Creating XML files with the DME
Hi All,
I'm working on an integration project between my company and HSBC, they are requesting that we supply our AP payment files for foreign currency in XML format.
I have some limited experience with the DME and know it can create XML files, however, the elements available for XML files are different to standard flat files. Also it doesnt seem like I can create files with multiple levels? e.g.
<InitgPty>
......... <Id>
............... <OrgId>
...................... <BkPtyId>ABC00103003</BkPtyId>
.............. </OrgId>
........ </Id>
</InitgPty>
Does anyone have any documentation or experience with creating XML files with DME?
thanks
Phil.Hi,
Please ask any Implementation team in ABAB or Report painter team with your friends,
Thanks and REgards
N.Soma Sundaram -
Using XSLT to extract value of a XML node with namespace
I have a XML source code here.
<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:job="http://www.pageuppeople.com">
<channel>
<title>SMH Jobs</title>
<link>internalrecruitment.smhgroup.com.au/jobsrss.ashx?stp=di</link>
<description>A listing of jobs available here</description>
<item>
<title>eCommerce Optimisation Advisor</title>
<description>A new and exciting opportunity exists for an experienced eCommerce Advisor to join</description>
<job:location PUReferenceID="3711">Sydney - Inner Suburbs & CBD</job:location>
</item>
</channel>
</rss>
I want to use XSLT to extract value of a XML node with namespace <job:location>, and the returned value should be string 'Sydney - Inner Suburbs & CBD'. I tried a few XSL code below, but failed with error or nothing was returned.
<xsl:value-of select="job:location" disable-output-escaping="yes"/>
<xsl:value-of select="job/location" disable-output-escaping="yes"/>
<xsl:value-of select="job\location" disable-output-escaping="yes"/>
<xsl:value-of select="location" disable-output-escaping="yes"/>
This might be an easy question for you, but I would appreciate if anyone can help.Hi Suncorp IT Learner,
We need to tell the XSLT that some elements are in another namespace. Copy the xmls declarations for the prefixes you need to use. Then use the xsl format as:
<xsl: value-of select=”job:location/@PUReferenceID”/>
In following issue, Chriztian has a good explanation:
http://our.umbraco.org/forum/developers/xslt/33353-XSLT-reading-XML-attribute-value
Thanks,
Qiao Wei
TechNet Community Support -
Create XML docs with hierarchy of tags and attr defined in databaste tables
Hi,
My problem is a little unique one. I want the ability to define the structure of the XML document (i.e. the hierarchy of element tags and attribute names) in the database tables. The values of tags and attributes will also be populated at runtime in tables.
Then write some generic API that reads the structure of the XML document through the database tables and spits out an XML document based on this structure and values stored in the tables.
So, basically, I want the tag names and values both to be values in the database rather than the tag names being the columns in database tables.
With this I should be able to have one procedure/function that can serve the purpose of creating XML documents with different structures by just specifying that structure in the form of database tables.
Almost all the Oracle XML utilities I read about, create XML docs based on a SQL query with tag names being columns in the database tables. Any help will be highly appreciated.
Thanks,
MonikaWhich database release are you using...
The computed constructors feature of XQuery may help.
-Mark -
Create xml file with values from context
Hi experts!
I am trying to implement a WD application that will have some input fields, the value of those input fields will be used to create an xml file with a certain format and then sent to a certain application.
Apart from this i want to read an xml file back from the application and then fill some other context nodes with values from the xml file.
Is there any standard used code to do this??
If not how can i do this???
Thanx in advance!!!
P.S. Points will be rewarded to all usefull answers.
Edited by: Armin Reichert on Jun 30, 2008 6:12 PM
Please stop this P.S. nonsense!Hi,
you need to create three util class for that:-
XMLHandler
XMLParser
XMLBuilder
for example in my XML two tag item will be there e.g. Title and Organizer,and from ur WebDynpro view you need to pass value for the XML tag.
And u need to call buildXML()function of builder class to generate XML, in that i have passed bean object to get the values of tags. you need to set the value in bean from the view ui context.
Code for XMLBuilder:-
Created on Apr 4, 2006
Author-Anish
This class is to created for having function for to build XML
and to get EncodedXML
and to get formated date
package com.idb.events.util;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.idb.events.Event;
public class XMLBuilder {
This attribute represents the XML version
private static final double VERSION_NUMBER = 1.0;
This attribute represents the encoding
private static final String ENCODING_TYPE = "UTF-16";
/*Begin of Function to buildXML
return: String
input: Event
public String buildXML(Event event) {
StringBuffer xmlBuilder = new StringBuffer("<?xml version=\"");
xmlBuilder.append(VERSION_NUMBER);
xmlBuilder.append("\" encoding=\"");
xmlBuilder.append(ENCODING_TYPE);
xmlBuilder.append("\" ?>");
xmlBuilder.append("<event>");
xmlBuilder.append(getEncodedXML(event.getTitle(), "title"));
xmlBuilder.append(getEncodedXML(event.getOrganizer(), "organizer"));
xmlBuilder.append("</event>");
return xmlBuilder.toString();
/End of Function to buildXML/
/*Begin of Function to get EncodedXML
return: String
input: String,String
public String getEncodedXML(String xmlString, String tag) {
StringBuffer begin = new StringBuffer("");
if ((tag != null) || (!tag.equalsIgnoreCase("null"))) {
begin.append("<").append(tag).append(">");
begin.append("<![CDATA[");
begin.append(xmlString).append("]]>").append("</").append(
tag).append(
">");
return begin.toString();
/End of Function to get EncodedXML/
/*Begin of Function to get formated date
return: String
input: Date
private final String formatDate(Date inputDateStr) {
String date;
try {
SimpleDateFormat simpleDateFormat =
new SimpleDateFormat("yyyy-MM-dd");
date = simpleDateFormat.format(inputDateStr);
} catch (Exception e) {
return "";
return date;
/End of Function to get formated date/
Code for XMLParser:-
Created on Apr 12, 2006
Author-Anish
This is a parser class
package com.idb.events.util;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import com.idb.events.Event;
import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
public class XMLParser {
Enables namespace functionality in parser
private final boolean isNameSpaceAware = true;
Enables validation in parser
private final boolean isValidating = true;
The SAX parser used to parse the xml
private SAXParser parser;
The XML reader used by the SAX parser
private XMLReader reader;
This method creates the parser to parse the user details xml.
private void createParser()
throws SAXException, ParserConfigurationException {
// Create a JAXP SAXParserFactory and configure it
SAXParserFactory saxFactory = SAXParserFactory.newInstance();
saxFactory.setNamespaceAware(isNameSpaceAware);
saxFactory.setValidating(isValidating);
// Create a JAXP SAXParser
parser = saxFactory.newSAXParser();
// Get the encapsulated SAX XMLReader
reader = parser.getXMLReader();
// Set the ErrorHandler
This method is used to collect the user details.
public Event getEvent(
String newsXML,
XMLHandler xmlHandler,
IWDMessageManager mgr)
throws SAXException, ParserConfigurationException, IOException {
//create the parser, if not already done
if (parser == null) {
this.createParser();
//set the parser handler to extract the
reader.setErrorHandler(xmlHandler);
reader.setContentHandler(xmlHandler);
InputSource source =
new InputSource(new ByteArrayInputStream(newsXML.getBytes()));
reader.parse(source);
//return the results of the parse
return xmlHandler.getEvent(mgr);
Code for XMLHandler:-
Created on Apr 12, 2006
Author-Anish
This is a parser class
package com.idb.events.util;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import com.idb.events.Event;
Created on Apr 12, 2006
Author-Anish
*This handler class is created to have constant value for variables and function for get events,
character values for bean variable,
parsing thr date ......etc
package com.idb.events.util;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.DefaultHandler;
import java.util.*;
import com.idb.events.Event;
import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
public class XMLHandler extends DefaultHandler {
private static final String TITLE = "title";
private static final String ORGANIZER = "organizer";
IWDMessageManager manager;
private Event events;
private String tagName;
public void setManager(IWDMessageManager mgr) {
manager = mgr;
This function is created to get events
public Event getEvent(IWDMessageManager mgr) {
manager = mgr;
return this.events;
This function is created to get character for setting values through event's bean setter method
public void characters(char[] charArray, int startVal, int length)
throws SAXException {
String tagValue = new String(charArray, startVal, length);
if (TITLE.equals(this.tagName)) {
this.events.setTitle(tagValue);
if (ORGANIZER.equals(this.tagName)) {
String orgName = tagValue;
try {
orgName = getOrgName(orgName);
} catch (Exception ex) {
this.events.setOrganizer(orgName);
This function is created to parse boolean.
private final boolean parseBoolean(String inputBooleanStr) {
boolean b;
if (inputBooleanStr.equals("true")) {
b = true;
} else {
b = false;
return b;
This function is used to call the super constructor.
public void endElement(String uri, String localName, String qName)
throws SAXException {
super.endElement(uri, localName, qName);
/* (non-Javadoc)
@see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
This function is used to call the super constructor.
public void fatalError(SAXParseException e) throws SAXException {
super.fatalError(e);
This function is created to set the elements base on the tag name.
public void startElement(
String uri,
String localName,
String qName,
Attributes attributes)
throws SAXException {
this.tagName = localName;
if (ROOT.equals(tagName)) {
this.events = new Event();
public static void main(String a[]) {
String cntry = "Nigeria";
XMLHandler xml = new XMLHandler();
ArrayList engList = new ArrayList();
engList = xml.getCountries();
ArrayList arList = xml.getArabicCountries();
int engIndex = engList.indexOf(cntry);
System.out.println("engIndex :: " + engIndex);
String arCntryName = (String) arList.get(engIndex);
System.out.println(
">>>>>>>>>>>>>>>>>>>>" + xml.getArabicCountryName(cntry));
Hope that may help you.
If need any help , you are most welcome.
Regards,
Deepak -
Create xml file with nested internla table or with header & item tables
Hi I have a requirement like, I need to create an xml file for header and item details. For 1 header there may be multiple line items.
I did search in forums some where I came to know that we can use XSL:IF to achieve this. but I could not able to do this.
I tried with using nested internal tables also but now luck.
can anybody please suggest how can we create xml for header and item detials.
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sap="http://www.sap.com/sapxsl"
xmlns:asx="http://www.sap.com/abapxml"
exclude-result-prefixes="asx"
>
<xsl:template match="/">
<OrbisomRequest>
<xsl:attribute name="Version">
<xsl:value-of select="11.1"/>
</xsl:attribute>
<xsl:attribute name="IssuerID">
<xsl:value-of select="1"/>
</xsl:attribute>
<xsl:for-each select="asx:abap[1]/asx:values[1]/T_FINAL[1]/*">
<CreateApprovedPurchaseRequest
RerquestID="{VBLNR}"
CommonName="User1"
Amount="{WRBTR}"
Comment="TestComment"
CurrencyCode="978"
PurchaseType="All"
SupplierName="All"
VCardAlias="PurchaseCard"
ValidFrom="1M"
CurrencyType="B">
<CDFs>
<Invoice> <xsl:value-of select="BELNR"/> </Invoice>
<Amount> <xsl:value-of select="WRBTR"/> </Amount>
</CDFs>
</CreateApprovedPurchaseRequest>
</xsl:for-each>
</OrbisomRequest>
</xsl:template>
</xsl:transform>
here belnr and wrbtr will be my item details. for each payment document I can have multiple invoices. in CDF I need to display the invoices for that particular payment document.
what conditions can I put there before CDFs to make the item internal table to loop based on header internal table.
Regards,
Ranganadh.Looks like you have already created the transformation "Z_ID"
Take a look at the following thread, it answers many of the questions you have asked:
[ABAP data to XML conv with UTF-8 encoding and custom namespace|Re: ABAP data to XML conv with UTF-8 encoding and custom namespace;
Che -
How to create XML element with out creating a document
I ve been looking for hours for a method to create an XML element without the need for the Document. I am trying to create objects that access the database, and I need in each of these objects a method that returns only an element (ie. getXMLData()). And in the class that created these object, I nee to call the getXML() methods and construct a document. However, I am not looking to create the document if I am not going to use it. In the component class I need to be able to traverse the xml element and read and modify the values. Is there a way to do so with sun's JDK ?
I ve been looking for hours for a method to create an
XML element without the need for the Document.
... I am not looking to create the document if I
am not going to use it.Hi M-A,
Though you have been told the solution, let's stick to your original issue, just for the sake of interest. I gather what you have in mind is finding the answer to the following question: is there a way of creating a document without having to bind it to any data source? The answer is yes. What you might need is the createDocument() method of the DOMImplementation interface which offers lightwight document handling by obviating the need to construct a particular DOM instance. (You could also use the getDOMImplementation() method of the DOMImplementationRegistry interface, but it has bugs.) Here's a sample code:DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder parser = factory.newDocumentBuilder();
DOMImplementation domImpl = parser.getDOMImplementation();
Document doc = domImpl.createDocument(null, "rootnode", null);The above code produces the following document:<?xml version="1.0" encoding="UTF-8"?>
<rootnode/>You can make this document even skinnier if you pass null values to all three parameters of the createDocument() method, in which case the document will only contain the prolog. I think both the creation and the structure of this document are simple enough for you to use it as some sort of utility (e.g. by putting the code in a separate class) for creating elements. -
Matching JS XML object with Indd XML elements
Hello Scripters,
I need help ...
I have some XML from a file read into a Javascript XML object.
The object has the name "myXml", and contains:
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<imagecontainer href="C:\33415677.JPG"></imagecontainer>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description><test>Sublevel</test>An in-depth look at creating applications with XML.</description>
</book>
... and several other books
I also have some XML in Indesign, wich in my JS is known as "myTplXmlRoot".
myTplXmlRoot is defined as myTplXmlRoot = mySelection.associatedXMLElement;
What would be the best approach for matching elements of the same name in the two xml structures, and where there is a match* replace the Indesign content**, with that from the object "myXml"?
*) Match if same name, dont worry about place in hirachy
**) content might be an imageI've figured out the solution to my problem. For anyone
interested, see me code below (the xml element names are different,
but the concept is the same). -
How must getElementsByTagName work on an xml file with namespaces?
Hello together,
is there any normative document, which specifies
which nodes must be returned by
the org.w3c.dom.Document method
getElementsByTagName when which was
created by a namespace aware dom parser
from an xml file containing namespaces?
In other words:
when you have an xml file:
<someprefix:somenode xmlns:someprefix="http://someuri">
<someprefix:innertag>
<someprefix:mostinnertag>
</someprefix:mostinnertag>
<someprefix:mostinnertag>
</someprefix:mostinnertag>
</someprefix:innertag>
</someprefix>
and you call
document.getElementsByTagName( ... );
1) How many nodes must be returned when giving
"mostinnertag" as parameter?
2) How many nodes when giving "someprefix:mostinnertag" as parameter?
Is it allowed to use the "non namespaceaware"
method and not "getElementsByTagNameNS"?
I know:
a) xerces returns 2 nodes when using
alternative 2 and none with alternative 1
b) oracle xml parser returns 2 nodes when using
alternative 1 and none when using alternative 2
Which implementation is right?
Yours
StefanI've got some problems with this methos and xerces too.
Perhaps the two implementations (xerces and oracle) are different. I mean xerces implementation gives you nodes of this name but without namespace and oracles's implementation gives you modes with namespace whose unprefix-name is "mostinnertag". -
XML access with namespaces?
Hi!
I started learning Flex by using Flex but now I have the
first problem I can't solve. I think this will be only a basic
problem but in other forums nobody could help me. And of course I
didn't find anything about this in the help. :)
In the following MXML-Code I tried to use the flickr SOAP API
which works, but I don't get the real usage of the new XML class.
As you can see in the function called "recieveFlickrResult" I'm not
able to access the attribute I want to. The syntax seems to be
correct in my eyes because, if I create a new XML-Object using the
XMLString I can access the attribute. I also tried several other
methods like attributes(), children() and so on. I really don't get
it.
I think I'm making a fundamental mistake! Maybe the way I'm
using the access through namespaces (function
"extractFlickrResponse") is wrong?
Maybe you want to try this MXML-File:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute" creationComplete="init();">
<mx:HTTPService id="flickrService" url="
http://api.flickr.com/services/soap/"
useProxy="false" contentType="application/xml"
resultFormat="xml"></mx:HTTPService>
<mx:Script>
<![CDATA[
public var apiURL:String = "
http://api.flickr.com/services/soap/";
public var api_key:String =
"0cdbd0b93883f563e3bea67611e44c83";
public var nsid:String;
public var urlRequest:URLRequest;
public var resultLoader:URLLoader;
public function debug(s:String):void{
debugTxt.text += s + "\r";
var sNS:Namespace = new Namespace("
http://www.w3.org/2003/05/soap-envelope");
var xNS:Namespace = new Namespace("urn:flickr");
public function generateSOAPRequestXML(method:String,
params:Object):XML{
var requestXML:XML = <s:Envelope
xmlns:s="
http://www.w3.org/2003/05/soap-envelope"
xmlns:xsi="
http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="
http://www.w3.org/1999/XMLSchema"
>
<s:Body>
<x:FlickrRequest xmlns:x="urn:flickr">
<method>{method}</method>
<api_key>{api_key}</api_key>
</x:FlickrRequest>
</s:Body>
</s:Envelope>
var flickrXMLList:XMLList =
requestXML.sNS::Body.xNS::FlickrRequest;
for (var param:String in params){
var newparamNode:XML =
<{param}>{params[param]}</{param}>
flickrXMLList.appendChild(newparamNode);
return requestXML;
public function extractFlickrResponse(response:XML):XMLList{
return response.sNS::Body.xNS::FlickrResponse;
public function startFlickrRequest(requestXML:XML):void{
urlRequest = new URLRequest(apiURL);
urlRequest.contentType = "text/xml";
urlRequest.method = URLRequestMethod.POST;
urlRequest.data = requestXML;
resultLoader = new URLLoader(urlRequest);
resultLoader.addEventListener("complete",
recieveFlickrResult);
public function recieveFlickrResult(evt:Event):void{
if (evt.type == "complete"){
var resultXML:XML = new XML(resultLoader.data);
debug("resultXML :\r" + resultXML);
var response:XMLList = extractFlickrResponse(resultXML);
debug("");
debug("response :\r" + response);
debug("response.@nsid : " + response.@nsid); // returns
nothing!
var newXML:XML = new XML(response.toString());
debug("");
debug("newXML :\r" + newXML);
debug("");
debug("newXML.@nsid : " + newXML.@nsid); //returns the value
public function init():void{
var nsidRequestXML:XML =
generateSOAPRequestXML('flickr.people.findByUsername', {username
:"der_raab"});
startFlickrRequest(nsidRequestXML);
]]>
</mx:Script>
<mx:TextArea id="debugTxt" text="" left="10" right="10"
bottom="10" top="10"/>
</mx:Application>I've never used the Flickr API before, but everything appears
to me to be behaving as expected. It appears, oddly enough, that
for some reason the FlickrResponse tag returns XML which is encoded
as a blob of text. That's strange to me, but perhaps there's a
reason for it -- but in any case, here is the XML that came back (I
captured this using the Charles web debugging proxy from
http://www.xk72.com/charles):
<s:Envelope xmlns:s="
http://www.w3.org/2003/05/soap-envelope"
xmlns:xsi="
http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="
http://www.w3.org/1999/XMLSchema">
<s:Body>
<x:FlickrResponse xmlns:x="urn:flickr">
<user id="42441977@N00"
nsid="42441977@N00">
<username>der_raab</username>
</user>
</x:FlickrResponse>
</s:Body>
</s:Envelope>
So check that out, there's that escaped XML on the inside. As
far as E4X is concerned, that is just text, so . So, as you do near
the end of your sample, you must take that text and use it to
create an XML object.
The "response.@nsid" which returned nothing is actually
looking for an nsid attribute on the <x:FlickrResponse> tag,
not on the text which is inside that tag. -
Create XML file with worksheet's dynamically assigned through XSLT
Hi all
I have a requirement to create a xml file with worksheets dynamically created based on a field value in the internal table .
I have all my values in internal table, and am calling the transformation from bsp application.
Say the internal table has field dataxyz, for every change in value in this field dataxyz i need to create separate worksheet and populate that sheet with some corresponding values .
please guide me how to create worksheet dynamically.
thanks in advance.
Bharathy
Edited by: elam.bharathy on May 16, 2011 6:51 AMCan you use a schema when we compose XML doc from Database tables?
Actually, I'm using SQL Server (sorry, wrong forum). But, I thought a Java tool would have a solution for me. -
Create lock object with fun command
Hallo,
Is it possible to create a lock object with the fun command? I tried to use:
FUN ( ENQUEUE _<lockobject> , <interface> ).
When I fill the importing parameters, execute the script and afterwards refresh the interace than the import parameters are empty. Is there a way to create a lock object with the fun command or at least with inline abap?
regards,
WolfgangHi Wolfgang,
in general your way of including the FUN command was correct.
The loss of import parameter values must have been caused by some other reason, not related to the invoke of enqueue. Maybe try it again.
If, for any reason, using FUN is not possible, it's always an alternative to use ABAP. .... ENDABAP. with correct ABAP coding inbetween (e.g. CALL FUNCTION ...).
Nevertheless regarding enqueue you need to consider, that the lock you set by running eCATT test scripts in this way, will last (only) as long as the session in which the function was called is active. Means, it lasts as long as you do not close the SECATT transaction (/n or similar) and not use commands like RESCON in your test script. Check your locks with transaction sm12.
Be aware, that interfering with an applications lock handling and strategy might also harm running transactions or the data processed by this transactions. Usually there is no need to call the enqueue modules from a test.
Best Regards
Jens
Maybe you are looking for
-
Using combination of insert into and select to create a new record in the table
Hello: I'm trying to write a stored procedure that receives a record locator parameter and then uses this parameter to locate the record and then copy this record into the table with a few columns changed. I'll use a sample to clarify my question a b
-
Use of global data in transformation with parallel processing
Hi, In an upgrade I have a global variable in a routine in 3.5 in a transfer rule. The global variable keeps count of an ID. The global variable is used in every data package,because the corrsponding infopackage is set to PSA only, where help says: "
-
We have couple of power users who need to be able to change an item's wording periodically. We added a text item to the same page group and enabled the security for these users. Now, my question is as following, when that specific user with the priv.
-
My I phone got an update and I have lost my you tube, You tell me that I can download you tube, can I get the same version, so I don't have to learn something new? Also, how do I get rid of Passbook?
-
Itunes stops while uploading a song and disconnects device
Hey there, for the last year I've been having an issue with itunes disconnecting and reconnecting the device it happens while I move any substantial file over to it such as a load of music or a movie or something; it also gives me another error somet