function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SurjenduSurjendu 

In XML StreamReader class what is the equivalent of the java method Node.getNodeValue();

In XML StreamReader class what is the equivalent of the java method Node.getNodeValue();
Without this method how do I get the node value of a particular node?
cheenathcheenath
XML Stream reader follows the StAX spec [1] and you can find javadoc here [2].

<foo>bar</foo>

Are you looking at getting the value of text node ("bar" above) ? Then you have
to use getText().

HTHs,


[1] https://sjsxp.dev.java.net/
[2] http://java.sun.com/webservices/docs/1.5/api/javax/xml/stream/XMLStreamReader.html

Ad_InfosysAd_Infosys

HI,

 

I am creating an XML reader in SFDC. where do I place the xml? and hw do i call or connect to the desired xml.

cheenathcheenath
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_XmlStream_reader.htm

String xmlString = '<books><book>My Book</book><book>Your Book</book></books>';
XmlStreamReader xsr = new XmlStreamReader(xmlString);



Ad_InfosysAd_Infosys

Thanks dear,

I have XML placed on my desktop of my machine. How do I call the same.

I mean if you can brief the steps to do that. I can copy the code mentioned in the link specified by you.

But how do i use the statements mentioned by you to read the XML.

 

Thanks.