Get position of xml-tag in clob
Hi,
Is it possible to get the offset in a clob, representing an xml, by using xml functionality? (function or xmltable)
For example, with a clob:
v_clob := '<a><b type="1">val1</b><b type="2">val2</b></a>';I would like a function like:
v_offset := xml_offset(v_clob,'/a/b[@type="2"]');With a result of 24 to get the tag, or 35 when asking for the actual value.
Thanks,
Jan
Edited by: BluShadow on 16-Jan-2013 15:22
added {noformat}{noformat} tags for readability. Please see {message:id=9360002} and learn to do this yourself in future.
p.s. if you have an unknown XML structure and you need to parse it somehow, then you will likely be best using the DBMS_XMLDOM package and treating it as a DOM document so that you can recurse the hierarchy of tags, picking out the attributes and data as you go.
ETA: Example from my library of examples...
declare
v_xml XMLTYPE := XMLTYPE('<csg>
<ecrminput id="000000001">
<xml id="001" title="CustomerId">blah blah blah</xml>
<xml id="002" title="ContactId">blah blah blah</xml>
<xml id="003" title="CustomerNo">blah blah blah0</xml>
<xml id="500" title="Attribute">blah blah blah</xml>
<xml id="500" title="Attribute">blah blah blah</xml>
<xml id="1027" title="Reservation Code">blah blah blah</xml>
<xml id="1028" title="Payment Reference">blah blah blah</xml>
<xml id="1029" title="Purchaser Customer Number">blah blah blah</xml>
</ecrminput>
<ecrminput id="000000002">
<xml id="001" title="CustomerId">blah blah blah</xml>
<xml id="002" title="ContactId">blah blah blah</xml>
<xml id="500" title="Attribute">blah blah blah</xml>
<xml id="500" title="Attribute">blah blah blah</xml>
<xml id="1027" title="Reservation Code">blah blah blah</xml>
<xml id="1028" title="Payment Reference">blah blah blah</xml>
<xml id="1029" title="Purchaser Customer Number">blah blah blah</xml>
<xml id="1016" title="Call ID">blah blah blah</xml>
</ecrminput>
</csg>');
v_xsdoc DBMS_XMLDOM.DOMDocument;
v_dn DBMS_XMLDOM.DOMNode;
PROCEDURE processnode; -- forward declaration
PROCEDURE processattributes IS
nm DBMS_XMLDOM.DOMNamedNodeMap;
attr DBMS_XMLDOM.DOMAttr;
attnode DBMS_XMLDOM.DOMNode;
attname VARCHAR2(50);
attval VARCHAR2(250);
BEGIN
nm := DBMS_XMLDOM.GetAttributes(v_dn);
FOR i IN 0..DBMS_XMLDOM.GetLength(nm)-1
LOOP
attnode := DBMS_XMLDOM.Item(nm, i);
attr := DBMS_XMLDOM.MakeAttr(attnode);
attname := DBMS_XMLDOM.GetName(attr);
attval := DBMS_XMLDOM.GetValue(attr);
dbms_output.put_line('Attribute: '||attname||' Value: '||attval);
END LOOP;
END;
PROCEDURE parse_node_element IS
eltype VARCHAR2(100);
BEGIN
eltype := DBMS_XMLDOM.GetTagName(DBMS_XMLDOM.MakeElement(v_dn));
dbms_output.put_line('Tag: '||eltype);
processattributes;
processnode;
END;
PROCEDURE parse_node_text IS
BEGIN
DBMS_OUTPUT.PUT_LINE('Text: '||DBMS_XMLDOM.GetNodeValue(v_dn));
END;
PROCEDURE processnode IS
dnl DBMS_XMLDOM.DOMNodeList;
nt PLS_INTEGER;
BEGIN
dnl := DBMS_XMLDOM.GetChildNodes(v_dn);
dbms_output.put_line('Child Nodes Found: '||DBMS_XMLDOM.GetLength(dnl));
IF NOT DBMS_XMLDOM.IsNull(dnl) THEN
FOR i IN 0 .. (DBMS_XMLDOM.GetLength(dnl) - 1)
LOOP
v_dn := DBMS_XMLDOM.Item(dnl, i);
nt := DBMS_XMLDOM.GetNodeType(v_dn);
CASE
WHEN nt = DBMS_XMLDOM.ELEMENT_NODE THEN
parse_node_element;
WHEN nt IN (DBMS_XMLDOM.TEXT_NODE) THEN
parse_node_text();
ELSE
NULL; -- Unhandled node type;
END CASE;
END LOOP;
END IF;
END;
BEGIN
v_xsdoc := DBMS_XMLDOM.NewDOMDocument(v_xml);
v_dn := DBMS_XMLDOM.GetFirstChild(DBMS_XMLDOM.MakeNode(v_xsdoc)); -- <csg>
processnode;
END;
Child Nodes Found: 2
Tag: ecrminput
Attribute: id Value: 000000001
Child Nodes Found: 8
Tag: xml
Attribute: id Value: 001
Attribute: title Value: CustomerId
Child Nodes Found: 1
Text: blah blah blah
Tag: xml
Attribute: id Value: 002
Attribute: title Value: ContactId
Child Nodes Found: 1
Text: blah blah blah
Tag: xml
Attribute: id Value: 003
Attribute: title Value: CustomerNo
Child Nodes Found: 1
Text: blah blah blah0
Tag: xml
Attribute: id Value: 500
Attribute: title Value: Attribute
Child Nodes Found: 1
Text: blah blah blah
Tag: xml
Attribute: id Value: 500
Attribute: title Value: Attribute
Child Nodes Found: 1
Text: blah blah blah
Tag: xml
Attribute: id Value: 1027
Attribute: title Value: Reservation Code
Child Nodes Found: 1
Text: blah blah blah
Tag: xml
Attribute: id Value: 1028
Attribute: title Value: Payment Reference
Child Nodes Found: 1
Text: blah blah blah
Tag: xml
Attribute: id Value: 1029
Attribute: title Value: Purchaser Customer Number
Child Nodes Found: 1
Text: blah blah blah
Tag: ecrminput
Attribute: id Value: 000000002
Child Nodes Found: 8
Tag: xml
Attribute: id Value: 001
Attribute: title Value: CustomerId
Child Nodes Found: 1
Text: blah blah blah
Tag: xml
Attribute: id Value: 002
Attribute: title Value: ContactId
Child Nodes Found: 1
Text: blah blah blah
Tag: xml
Attribute: id Value: 500
Attribute: title Value: Attribute
Child Nodes Found: 1
Text: blah blah blah
Tag: xml
Attribute: id Value: 500
Attribute: title Value: Attribute
Child Nodes Found: 1
Text: blah blah blah
Tag: xml
Attribute: id Value: 1027
Attribute: title Value: Reservation Code
Child Nodes Found: 1
Text: blah blah blah
Tag: xml
Attribute: id Value: 1028
Attribute: title Value: Payment Reference
Child Nodes Found: 1
Text: blah blah blah
Tag: xml
Attribute: id Value: 1029
Attribute: title Value: Purchaser Customer Number
Child Nodes Found: 1
Text: blah blah blah
Tag: xml
Attribute: id Value: 1016
Attribute: title Value: Call ID
Child Nodes Found: 1
Text: blah blah blah
PL/SQL procedure successfully completed.Edited by: BluShadow on 16-Jan-2013 15:28
Similar Messages
-
How do I get rid of xml tags but not when the tag has copyright in it?
I tried this but it does not seem to do anything:
temp_string=temp_string.replaceAll("\\<.*?(!copyright)\\>", "");An example of this is that if I have: <meta name ="copyright" > I do not want to get rid of the tag. In other words, I do not want to get rid of any tags that have the word "copyright" in them, but I want to get rid of all other tags.
Edited by: setaret2004 on Dec 16, 2008 4:11 PMsetaret2004 wrote:
Also if I want to include license as well do I just do: str = str.replaceAll("<(?![^<>]*(copyright|license))[^<>]*>", ""); Is that correct?Yes, you can do the same thing with all three regexes. Now, explanations:
"<(?![^<>]*copyright)[^<>]*>" This regex does one lookahead, scanning forward for the word "copyright" before beginning the actual match. It's a negative lookahead, so if the word is seen, the lookahead fails and so does the overall match. If the lookahead succeeds, the match position is returned to where the lookahead started and the real matching begins.
A naïve approach would use ".*" or ".*?" in the lookahead, but then it would be free to scan past the end of the tag and find the word in the next tag or halfway through the document; lookaheads are slippery that way. But I used "[<>]*", so once it reaches the closing ">" it stops scanning.
That means, for every successful match the regex scans the whole tag twice--once for the lookahead and once "for reals". That won't be a problem in most cases, but if you're matching many large chunks of text, performance could suffer. Each of the other regexes only traverses the tag once. "<(?:(?!copyright)[^<>])*>" This one steps through the text one character at a time, at each position doing a negative lookahead before matching the character. That sounds like a lot of work, but in the vast majority of cases the lookahead will only have to look at one character before yielding.
"<(?:(?!copyright|[<>]).)*>" This is basically the same as the second regex, but it does all the real work in the lookahead. I don't recommend it; it's less readable and probably less efficient than the second regex. But both the second and third regexes can be made more efficient by using [possessive quantifiers|http://www.regular-expressions.info/possessive.html] (that whole site is highly recommended, by the way): "<(?:(?!copyright)[^<>])*+>", "");
"<(?:(?!copyright|[<>]).)*+>" The first regex can use a possessive quantifier, too, but not in the lookahead: "<(?![^<>]*copyright)[^<>]*+>" -
Adobe InDesign CS5 Server JavaScript: Get rectangle by XML tag
Hi,
Current set-up:
Adobe InDesign Server CS5 scripted through ExtendScript via PHP SOAP
The problem:
I'm currently placing an image file into a rectangle using the following code:
frame = doc.rectangles[0];
imgList = frame.place(new File(img));
This works fine; the img file is placed into the rectangle as expected. However, this only refers to the first rectangle in the document: if I have two rectangles in the document, the image is placed into the last created rectangle.
What I'd ideally like to be able to refer to the rectangle by its XML tag - something like:
frame = doc.getRectangleByTag('Pic'); // <Pic> being the name of the XML tag
imgList = frame.place(new File(img));
Does anyone have any advice as to how this can be achieved? I realise this is rudimentary question, but am finding no joy after several hours of searching.
Many thanksWhat I'd ideally like to be able to refer to the rectangle by its XML tag - something like:
frame = doc.getRectangleByTag('Pic'); // <Pic> being the name of the XML tag
imgList = frame.place(new File(img));
Are you sure you want to do it this way?
Could you explain why? I suspect there is a better solution.
In any case, at least in my test case, the XML tag is associated with the image inside the frame and not the frame itself. So if you want the frame, you must get the image associated with the tag and then go up to the parent. This works in a simple test:
var frame =
app.activeDocument.xmlElements[0].
evaluateXPathExpression("//tennis")[0].
graphics[0].parent;
[object Rectangle] -
Get method ignores xml tags?
This is what I have in my little servlet:
response.setContentType("text/xml;charset=UTF-8");
PrintWriter out = response.getWriter();
String xmlRequest = request.getParameter("xml");
if (xmlRequest != null)
out.println("Client request: " + xmlRequest);
}When I tried passing the data to the server (where the servlet resides), the output on the browser shows...
Client request: hihi2
But the output that I was hoping to see is actually <test><hi>hi</hi><hi2>hi2</hi2></test> since I did the request this way: http://localhost:8084/HS/HSServlet?xml=<test><hi>hi</hi><hi2>hi2</hi2></test>
Please advise.
Thanks.You probably want to HTML encode the XML string, like this:
<test><hi>hi</hi><hi2>hi2</hi2></test>If you have embedded the XML directly in an HTML form, then chances are the browser is filtering out the XML tags as unrecognized HTML tags. Either of these examples would pose a problem:
<form action="http://localhost:8084/HS/HSServlet">
<input name="xml" value="<test><hi>hi</hi><hi2>hi2</hi2></test>">
<input type="submit">
</form>or
<a href="http://localhost:8084/HS/HSServlet?xml=<test><hi>hi</hi><hi2>hi2</hi2></test>">Test</a> -
How to get all xml tags in a text frame?
I want to get all the xml tags of the text in a text frame. I had tried the following methods but always get the tag binding the frame itself. <br /><br />1) XMLReference objXMLRef = Utils<IXMLUtils>()->QueryXMLReferenceData(textModel, 1);<br /><br />2) XMLReference objXMLRef = Utils<IXMLUtils>()->GetStoryThreadXMLReference(textModel, textIndex);<br /><br />Thanks in advance.
I would think if you intanciate the XMLReference and use IIDXMLElement GetChildCount / GetNthChild would do what you are looking for.
Ian -
How can I replace a text/range of text enclosed in a XML tag
I want to replace a piece of text enclosed inside a XML tag in a text frame.
In my input parameters, I have the In-design document page number, text frame UID in that page and the XML tag name inside that text frame
which encloses my old text.
what command/function/interface can I use which can help me to replace the existing text with the input text ?
eg:
[old text] -----> [new text]
where [ ] is XML tag with name tag1.After some trail and POC, I was able to write the below piece of code.
This detects the starting and ending position of the marker and based on that we can replace the text inside it. Hope it helps.
InterfacePtr<IDocumentSignalData> data(signalMgr, UseDefaultIID());
if (data == nil)
break;
UIDRef docRef = data->GetDocument();
InterfacePtr<IDocument> doc(docRef, IID_IDOCUMENT);
IDataBase *db = docRef.GetDataBase();
//Get the spread
InterfacePtr<ISpreadList> spreadList(doc, UseDefaultIID());
int32 spreadCount = spreadList->GetSpreadCount();
for ( int32 spreadIndex = 0; spreadIndex < spreadCount; spreadIndex++ )
// Get the spread reference
UIDRef spreadUIDRef(db, spreadList->GetNthSpreadUID(spreadIndex));
// Get the spread object
InterfacePtr<ISpread> spread(spreadUIDRef, UseDefaultIID());
int32 numberOfPages = spread->GetNumPages();
for (int32 nPage = 0; nPage < numberOfPages; nPage++ )
UIDList pageItemList(db);
spread->GetItemsOnPage(nPage, &pageItemList, kFalse, kFalse);
// Iterate the page items and save off the UIDs of frames.
int32 pageItemListLength = pageItemList.Length();
for (int32 j = 0; j < pageItemListLength; j++ )
UIDRef pageItemRef = pageItemList.GetRef(j);
InterfacePtr<IFrameType> frame(pageItemRef, UseDefaultIID());
if( frame->IsTextFrame() )
//Now trying to get the marker position for XML tag
TextIndex startPos=0,endPos=0;
IXMLReferenceData *xmlReferenceData= Utils<IXMLUtils>()->QueryXMLReferenceData(pageItemRef);
XMLReference ref = xmlReferenceData->GetReference();
//IIDXMLElement *element = ref.Instantiate();
InterfacePtr<IIDXMLElement> element(ref.Instantiate());
UID tagUID = element->GetTagUID();
WideString elementName = element->GetTagString();
for(int32 i=0; i < element->GetChildCount(); i++)
XMLReference childRef = element->GetNthChild(i);
InterfacePtr<IIDXMLElement> child_element(childRef.Instantiate());
tagUID = child_element->GetTagUID();
elementName = child_element->GetTagString();
int32 index=0;
Utils<IXMLUtils>()->GetElementMarkerPositions(child_element,&startPos,&endPos);
startPos += 1; // move forward to exclude the starting tag
} // iterate pages in spread -
I have a process that runs a SQL query and returns the results as XML. When I test the query in the Process Properties tab in Workbench it appears to execute just fine. I can also test the XML information and see that the results are coming back correctly. But when I invoke the process I get an emtpy XML tag with no results. Recording the invocation and playing back the recording doesn't tell me anything useful. Has anyone ever seen this issue before? I don't understand why everything within the process seems to bring back results just fine but invoking it returns nothing.
Unfortunately I am not the admin for our LiveCycle instance and do not have access to the server logs (long story). I also am not authorized to share any LCA files for this project. Thanks though.
-
Remove Empty XML Tags using module parameters
Hi All,
In my lanscape I have two PI Systems.
My scenario is an IDOC reaches 1st PI system gets converted into an EDIFACT and then goes to the 2nd PI and from there it gets routed to the respective AS2 Party.
I am using SOAP to pass message between the PI systems and B2B Toolkit's AS2 Adapter for the communication with AS2 party.
The issue is when the message is getting converted from IDOC to EDIFACT there are a few feilds with occurence 1..1 and due to these fields i get an empty XML tag at the output. These empty XML tags give me an error in the B2B Toolkit's AS2 Adapter Receiver Channel
I cannot change the occurence in the structure of the EDIFACT nor can I use an XSLT mapping to remove empty tags before the message reaches the Communication Channel.
I want to know if there are any module parameters which i can use either in SOAP Channel or the AS2 Channel to remove the XML Tags.Hi Muni,
"1..1 means, you must send some values for that fields. try to find out why these are not getting any values."
This empty tag is expected. Before using B2B Toolkit's AS2 Adapter we used to use Seeburger's AS2 Adpater and the message used to get executed successfully with these empty tags.The issue is coming only when we are using B2B Toolkit's AS2 Adapter.
"if you want to stop sending(the fields which are not needed in target) you can you can disable the fields in the message mapping."
I cannot disable the feild in the mapping as some other message may use this field.
Thanks,
Farhaan -
Want to include ?xml tag and schema when creating XML
My database table that need to be generated in to XML are large and therefore I must use OracleXMLQuery.getXMLSAX . The output is missing the <?xml version="1.0" ?> tag. How do I get it? I am on 9i but have imported the .jar containing oracle/xml/parser/v2/XMLSAXSerializer from 10g XDK.
Also, I want the schema to be written next, before the actual XML table values.
I know that a command line parameter exists, which works for small XML files:
java oraclexml getxml -user "scott/tiger" -withDTD "select ....
How do I get the equivalent of '"-withDTD" when using
OracleXMLQuery qry = new OracleXMLQuery(conn, "select * from "+table_name );
qry.getXMLSAX(myStream);
myStream.flush();
Thank you,
ElaineNo. Actually, I can get the <?xml tag and DTD if my select statement contains 'where rownum=0', as the resultset is small which lets me use getXMLMetaData() .
I write it to one output file, then do another OracleXMLQuery, repeating the select statement without the where clause, and run that through getXMLSAX to get the detail.
Next, I need to scrub the data of special characters acceptable in the database but which cause problems to a browser or XML validator. (e.g. accented characters).
Finally, I will concatente the two files.
Is there a simpler way to do this?
Thanks,
Elaine -
How to get the position of a tag in XML,when i am using the org.xml.sax
Hi,
I am able to parse a xml document.I want to get the position of a tag in the document.So that by keeping that as reference, i can access other tags.Plz help me.I am using org.xml.sax API.Hello Friends
After research , I could also find another way to check the existence of a node .We can even use CHOOSE to check the existence.
<xsl:choose>
<xsl:when test="(/mynode)">
your action if the mynode is found
</xsl:when>
<xsl:otherwise>
action if mynode is not found
</xsl:otherwise>
</xsl:choose>
Thanks.
Wishes
Richa -
Getting unwanted values between the XML tags in XSLT mapping
Hi Folks
I have come across a very strange situation with my xslt mapping.
I am getting unwated values "11" between xml tags
as follows
<Tag>0001</Tag>
11
<DataID>3</DataID>
I am not sure why I am getting these values in between the tags. Any suggestions would be appreciated.Hi David,
Here is the code fragment where these 2 tags are mapped, FYI, the source is an IDOC message. The unwanted "11" is coming After the <Tag></Tag> and <DataID></DataID>. FYI, Fof the element <Tag></Tag> its a default value. But for <DataID> </DataID> I have the mapping logic.
<Order>
<OrderHeader>
<Tag>009</Tag>
<xsl:for-each select="E1EDKA1">
<xsl:choose>
<xsl:when test="normalize-space(PARVW) = 'WE' and normalize-space(LIFNR) = 'U960'">
<DataID>
<xsl:value-of select="'1'" />
</DataID>
</xsl:when>
<xsl:when test="normalize-space(PARVW) = 'WE' and normalize-space(LIFNR) = 'U300'">
<DataID>
<xsl:value-of select="'3'" />
</DataID>
</xsl:when>
<xsl:when test="normalize-space(PARVW) = 'WE' and normalize-space(LIFNR) = 'U930'">
<DataID>
<xsl:value-of select="'1'" />
</DataID>
</xsl:when>
<xsl:when test="normalize-space(PARVW) = 'WE' and normalize-space(LIFNR) = 'U400'">
<DataID>
<xsl:value-of select="'3'" />
</DataID>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'1'" />
</xsl:otherwise>
</xsl:choose>
</xsl:for-each> -
Hi,
I am trying to get the attribute values of an XML Tag of a Textbox. To get the xml tag of the selected element, I use
InterfacePtr<IXMLTagSuite> xmlTagSuite(fCurrentSelection,UseDefaultIID());
if (xmlTagSuite)
UIDList tagUIDList = xmlTagSuite->GetTags();
UID tagID;
UIDRef tagUIDRef;
for(int32 i=0; i < tagUIDList.Length();i++)
tagID = tagUIDList[i];
tagUIDRef = UIDRef(fCurrentSelection->GetDataBase(), tagID);
InterfacePtr<IXMLTag>xmlTag(tagUIDRef,UseDefaultIID());
if (kTrue == tagUIDRef.ExistsInDB()) {
tagName = xmlTag->GetTagName();
err = kSuccess;
since I am totally new to this, It would help a great deal if you could tell me how to iterate thourgh the attribute values of that tag.
Thanks so much in advance
Benny"Tags" are what appear in the Tags palette. "Elements" are what appear in the Structure View. Tags do not have attributes, elements are the ones with attributes. Instead of looking at the tags, you should be looking for the elements. Find the element that's associated with the story, and IIDXMLElement should have attributes you can loop through.
-
Form or form on report to update XML tagS stored in CLOB field.
I would like to create a form or a form on a report
where i can update xml tags. The xml data is stored in a CLOB field.
sample CLOB DATA
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE preferences SYSTEM 'http://java.sun.com/dtd/preferences.dtd'>
<preferences EXTERNAL_XML_VERSION="1.0">
<root type="user">
<map />
<node name="com">
<map />
<node name="mynode">
<map />
<node name="utils">
<map />
<node name="properties">
<map>
<entry key="Save" value="ON" />
<entry key="TM_PORT" value="55555" />
<entry key="TM_PORT2" value="7777" />
<entry key="SubID" value="all" />
<entry key="UserDBUsr" value="myuser" />
<entry key="JMS_JDBC" value="OFF" />
<entry key="Side" value="BUY" />
<entry key="HEALTH_MONITOR_CRITICAL_DISK_SPACE" value="500" />
<entry key="HEALTH_MONITOR_WARNING_DISK_SPACE" value="750" />
<entry key="HEALTH_MONITOR_PERIOD" value="600000" />
</map>
</node>
</node>
</node>
</node>
</root>
</preferences>
the goal is to have a form where i can view and update the "value" of following:
TM_PORT
TM_PORT2
SubID
UserDBUsr
JMS_JDBC
Side
HEALTH_MONITOR_CRITICAL_DISK_SPACE
HEALTH_MONITOR_WARNING_DISK_SPACE
HEALTH_MONITOR_PERIOD
I have searched around this forum but could not find an example.
it would be cool if I could also load the an xml file into the clob.
Thank you.Hi,
I think you just study first the topics about XML DB to understand how to manupulate xml data in the database.
See:
http://www.oracle.com/technology/tech/xml/xmldb/index.html
and
XML DB
Regards,
Cafer -
Getting characters in a particular xml tag type during Sax parsing.
How do I get the text within a certain XML tag using the parser. I can use the parser which will get me all the text in all the tags, but how do I get the ones I need only.
For example:
<channel id="south-east.bbc1.bbc.co.uk">
<display-name lang="en">BBC1</display-name>
<display-name>1</display-name>
</channel>
<programme start="20040217233500" stop="20040218000500 +0000" channel="south-east.bbc1.bbc.co.uk">
<title lang="en">Film 2004 with Jonathan Ross</title>
</programme>how do I get the text 'Film 2004 with Jonathan Ross' without getting the others?Well, the SAX parser just gives you the start/end tag
information to a handler, right? So if you just use
the SAX parser to get one item, then you could do it
by running thru the entire XML file to get that item
then get another item. Clearly this isn't the best
way to do it.... The handler should put the data for
the whole document into some data structure, or use
DocumentBuilder to get a Document object. I see. Yes, that is not the way to use SAX. It's kind of an inside out way of doing things. If you using SAX you should know everything that you want before parsing and grab all of them in one fell swoop.
If you want to get an in memory representation, the JDOM package is a whole lot eaiser to use than DOM. -
Getting the 'name' of an XML tag
I am trying to get the 'name' value out of an XML tag. Here is the XML that I am parsing:
<param name="param_name">param_value</param>
I can get the values 'param' and 'param_value' using the node.getNodeName() and the node.getNodeValue() methods.
I need the value of "param_name" though because in the situation that I am in, this is how the node values are determined.
Any thoughts? Thanks in advance!Hello,
"name" is called an attribute of the "param" element. You could try to take a look at the getAttributes() function (node.getAttributes().item(0)).
I hope it helps.
Maybe you are looking for
-
My phone says iphone disabled connect to itunes, what do i do to get my phone back
-
Is anyone having a problem connecting to facetime
My facetime calls on Iphone 5 does not connect.... is anyone else having this issue
-
Considering I've tried everything to get iTunes up...
...and nothing seems to work... Should I call the Best Buy Geek Squad? Do they know anything about fixing iTunes?
-
Views for PO related tables?
Hi Guys, Can anybody tell me any views for PO tables with EKKO,EKPO,EKKN and EKBE ? I am using these tables for displaying a report and i have to get EKBE-BELNE ,EKKN-(PRCTR,ANLN1) , EKPO-(EBELP,NETPR,KNTTP),EKKO(EBELN
-
Text Substitution: using subscript.
I'd like to set up some automatic text substitutions for chemical compounds, with correct subscript (i.e O2, H2O, CO2 etc). Text formatting doesn't seem to work in the automatic corrections pane. This seems like a fairly simple request; is there some