XPath: get element from node with namespace?
I have a problem retrieving an element value via XPath. The XML is like
<?xml version="1.0" encoding="UTF-8"?>
<SOAP:Envelope ...>
<SOAP:Header>
</SOAP:Header>
<SOAP:Body>
<A xmlns="myns/">
<B>
<C>
<D>123</D>
...I want to retrieve node 'D'. I was able to select node 'A' with this XPath:
//SOAP:Body/child::*[namespace-uri()='myns']but can't get further. E.g.
//SOAP:Body/child::*[namespace-uri()='myns']/Bdoesn't work ...?
I have a problem retrieving an element value via
XPath. The XML is like
<?xml version="1.0" encoding="UTF-8"?>
<SOAP:Envelope ...>
<SOAP:Header>
</SOAP:Header>
<SOAP:Body>
<A xmlns="myns/">
<B>
<C>
<D>123</D>
ode]
I want to retrieve node 'D'. I was able to select
node 'A' with this XPath://SOAP:Body/child::*[namespace-uri()='myns']
but can't get further. E.g.
//SOAP:Body/child::*[namespace-uri()='myns']/Bdoesn't work ...?
Is there any solution to this problem?
Similar Messages
-
Strange problem with removing element from node
Hi,
I have a problem when I removed elements from a node.
here is the code:
String text = "123456";
IANode nodeA= wdContext.nodeA();
wdContext.nodeB().invalidate();
IBNode nodeB = wdContext.nodeB();
for(int i=0; i<nodeA.size(); i++)
IAElement e = nodeA.getEt_Emp_RespElementAt(i);
if (e.getID().compareTo(text)!= 0)
nodeB.removeElement(e);
else
wdComponentAPI.getMessageManager().reportSuccess(e.getID() + " was not removed");
The node A does have a row with field "ID" equals to 123456.
When running the application, it does write that "123456" was not removed...but it removes it....In fact my table is now empty.
How is it possible if it didn't perform the remove operation for ID = 123456 ?
Thanks in advance.David,
Because you are iterating node in wrong direction: see my reply to your post Re: Loop problem (seems that you assigns me 2 points without reading reply, and mark it as solved just because you stop solving it
So, in example in this thread, you must iterate node B in reverse direction, get element from B and remove it from B if it has some specific ID.
Valery Silaev
EPAM Systems
http://www.NetWeaverTeam.com -
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 -
How did my stored files get converted from 'open with Adobe READER' to 'open with Adobe ACROBAT'? How can I get them re-set to open with 'Adobe Reader'?
Please reply to my e-mail: [email protected]It sounds as if you downloaded Adobe Acrobat Pro. If you did, uninstall it. Then repair Adobe Reader.
The free Acrobat account has no connection to any of this. -
Xpath: get attributes from first child node
Hi,
I have some problems by getting the attributes from the first child node, if i try to get child elements everything works fine, but whenever i need the elementvalue from a node with attributes i doesn't return anything.
The xpath expression works fine if i want to get the element value from all childs, but not when i just want from one of them.
This one works,
XPathFactory factory1 = XPathFactory.newInstance();
XPath xpath = factory1.newXPath();
xpath.setNamespaceContext(new PersonalNamespaceContext());
XPathExpression expr
= xpath.compile("//default:DeviceExchange[1]/default:Status/text()");
// gets the value of the node picked out
Object result = expr.evaluate(doc, XPathConstants.NODESET);
NodeList nodes = (NodeList) result;
for (int i = 0; i < nodes.getLength(); i++) {
names[i] = nodes.item(i).getNodeValue();
String a = names;
// checks if status is exchanged, if it is sets status to 1
if (a.length() == 9){
names[i] = "1"; }
else{ names[i] = "0";}
System.out.println(names[i]);This doesn'tXPathFactory factory2 = XPathFactory.newInstance();
XPath xpath2 = factory2.newXPath();
xpath2.setNamespaceContext(new PersonalNamespaceContext());
XPathExpression expr2 = xpath2.compile("//default:DeviceExchange[1]/default:Field[@names='MLPKTID']/text()");
Object result2 = expr2.evaluate(doc, XPathConstants.NODESET);
NodeList nodes2 = (NodeList) result2;
for (int i = 0; i < nodes2.getLength(); i++) {
names2[i] = nodes2.item(i).getNodeValue();
System.out.println(names2[i]);}Does anyone have any ideas? I will apreciate all help!
Edited by: fusen on Oct 25, 2007 1:12 AMSorry, solved myself. Just � typo that that i couldn't detect.
-
Retrieving all UI Elements from window with Applescript
Hi All..
I want to retrieve all the ui elements from one of the window in runtime with Applescript.
The problem is in order to get the elements of the particular window i need to pass thru the hierarchy like UI element 1 of scroll area 1 of window 1 etc..
How do i get the hierarchy at the runtime??
For eg: if the hierarchy level is 3, i can get the UI elemets like.. ui elements of ui elements of ui elements of window 1.. this works fine
but i want to repeat the same statement in loop, till i get some elements, how do i achieve the same??
I tried the below code its not working for me... Pls suggest
set allButtons to {}
set i to 0
tell application "System Events"
tell process "Install Adobe Reader"
set num to count of UI elements of window 2
set element to every UI element of window 2
repeat with i from 0 to num
if class of element is button then
return true
else
set element to (a reference to UI elements of element)
set num to count of UI elements of element
end if
end repeat
end tell
end tellmadhusudhanjr wrote:
actually am implementing Applescripts in Java, the output what we get in Java is not exactly similar to Applescript.. Is their any way to make a list or Array of the above codes output??
Because they are objects.
Here's how to convert these objects in text format :
set allButtons to ""
tell application "System Events"
tell process "Install Adobe Reader"
with timeout of 0 seconds
set tElements to entire contents of window 1
end timeout
repeat with i in tElements
if class of i is button then try
i as text
on error err
tell my cleanUpErr(err) to if it is not "" then set allButtons to allButtons & it & linefeed
end try
end repeat
end tell
end tell
allButtons
on cleanUpErr(t)
set oTID to text item delimiters
try
set text item delimiters to "«" -- remove description of the error at beginning of the text
set t to "«" & (text items 2 thru -1 of t) as text
set text item delimiters to " of «class pcap»" -- remove 'of process "xxxx" of application "System Events"'
set r to text item 1 of t
set text item delimiters to oTID
return r -- return object in text format
end try
set text item delimiters to oTID
return ""
end cleanUpErr
You will get a button to each line (the last line will be empty).
Here is an example of the result :
«class butT» 1 of window "xyz"
«class butT» "bla" of window "xyz"
«class butT» 3 of window "xyz"
«class butT» "OK" of «class scrb» 1 of «class scra» 1 of window "xyz"
Each line is compilable in (osascript or in the Editor) without changing the text even if some of the classes are Raw Code --> «class butT» -
Hi,
I get the Session list with this statement:
session.list();
To get it I used:
session.get("username");
I want to get username, userfirstname, and userlastname into
separate TextInput UI components.
Only what I have so far is lastResult for all three
components.
Could you please help me?
Thanks,
SlavaHi,
Can you please clarify the following
1. what is the format of the data in the lastResult
2. what is this session.list(). Is it on the server?
3. how are the userFirstname and other variables available to
the Flex client
4. If the values are coming from web server, How are
accessing the web server and in format are the values returned.
Thanks -
Add child element by name with namespace
I'm trying to add element by name that is in namespace. This call
mod.addAppendStep ( Exp, XmlModify.Element, Name, Text )
fails with error:
Error: XmlModify::addStep: Cannot create content for step
Name in abobe call is "my_ns:elem_name", query context is linked to that namespace (I tried query context not linked to namespace as well).If you want to add an element in a namespace, you need to do it using an empty name, and put the element (with namespace decl). E.g.:
mod.addAppendStep(Exp, XmlModify.Element, "", "<my_ns:elem_name xmlns:my_ns='uri_for_my_ns' />").
The exception you're seeing is saying that it can't create the content, and the content is created by parsing what is passed in, and <my_ns:elem_name/> is not well-formed (namespace prefix hasn't been mapped).
Regards,
George -
How to get Elements from old computer to new?
Hello,
I bought elements last year sometime for my ibook, but just recently upgraded to an imac. I would like to get elements on my new computer but can't figure how to.
I also can't seem to find my serial number anywhere.
any suggestions?You will need to reinstall it. Do not attempt to bring it over with migration assistant, since PSE is far more complex than a normal neat mac app package and the MA isn't programmed to find alll the bits and bobs. If you bought PSE as a download, go to the main page of adobe.com and look for My Adobe and work your way through the links there and hopefully you'll still have a download link. If you registered it you will also find your serial number there, regardless of whether you bought a disc or a download.
-
WPF - Get files from directory with a shorter path
Hello,
I want to list the files in a combobox. My main question is how to get those files? I saw Directory.GetFiles(path), but I have to write the whole path (C:\Folder1\Folder2\Folder3\Folder4). How will this work on an other PC? Is somehow possible to write
the path beginning just form the app's folder? For example: the .exe is in "C:\Folder1\Folder2", and now the path what I have to write is just ":\Folder3\Folder4".
Thanks!I may be misunderstanding; please correct me if I am. It sounds like you want to get a list of the files in the same directory as the program that's executing.
//A few ways to get files from the same location as the code that is executing:
//Enumerate through each file
foreach(var fileInfo in new System.IO.FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.EnumerateFiles())
//Get a collection of file information objects
System.IO.FileInfo[] fileInfos = new System.IO.FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.GetFiles();
//Get the name of the directory
string directoryName = new System.IO.FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).DirectoryName;
WinSDK Support Team Blog: http://blogs.msdn.com/b/winsdk/ -
Get elements from external sites with rest
Hello!!!
I have a site collection in SPO2013 and i would like to read texts from a Drupal site and show it in my SP site. Is possible to do that with REST? if so, how? Is there some tutorial?
Thanks!!!Hello,
Yes you can create list items inside your SharePoint site using rest api. here is the simple function for your understating,
// Adding a list item with the metadata provided
function addListItem(url, listname, metadata, success, failure) {
// Prepping our update
var item = $.extend({
"__metadata": { "type": getListItemType(listname)}
}, metadata);
// Executing our add
$.ajax({
url: url + "/_api/web/lists/getbytitle('" + listname + "')/items",
type: "POST",
contentType: "application/json;odata=verbose",
data: JSON.stringify(item),
headers: {
"Accept": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val()
success: function (data) {
success(data); // Returns the newly created list item information
error: function (data) {
failure(data);
you can refer to the article below which explains basic CRUD operations using REST api with simple code examples:
http://www.plusconsulting.com/blog/2013/05/crud-on-list-items-using-rest-services-jquery/
Regards,
Subhash Reddy.
subhash reddy -
How to get photos from iphone5 with unresponsive screen
My iphone was dropped a few days ago and the screen became unresponsive. All the buttons work fine, but I can't swipe to turn it on or enter my passcode. I took the phone to an Apple store and was told by a not-nice guy that there was nothing they could do and that I could not get any of my photos off of the phone because I had the phone passcode protected. I thought Apple wanted everyone to passcode their phones! I wish I had known that this would prevent me from accessing my photos if anything happened to my phone.
I have sadly come to accept that my phone cannot be fixed and that I will need to shell out big bucks for a replacement. However, I cannot accept that there is no way to retrieve the material on my phone. When I plug the phone into the computer, it is recognized fine and stuff will download to the phone. However, iTunes tells me that it cannot synch FROM the phone until I enter the passcode on the phone, which of course, I cannot do .
I am really hoping that someone will know some trick to getting stuff off of a phone with an unresponsive screen. Please, please help this very sad iphone user. The photos are all the photos I have of my young daughter. I know, I should have learned to to back my phone up, but when I tried a few months ago, I couldn't figure it out, so I have no backup. I even tried to set up iCloud, but I couldn't figure that out either. I suppose I deserve to lose all the photos from my daughter's babyhood . Thanks for helping if you can! (please!!)Dear Dilbert41, thanks so much for your reply. In "my computer", it shows "other" and "photostream (system folder)". When I try to open the photostream, it says "photostream is not enabled. Sign in to icloud to view photostream. Open icloud control panel." So, if I click on the open icloud control panel and enter my apple id, it tells me that icloud has not been set up. So, I tried to set up icloud, but it appears that I have to set it up ON my iphone first, which I cannot do because the screen is broken. If I could use the screen, it appears I could get around the passcode. Instead, I have the passcode, but I cannot enter it because the screen does not work. I'm sure I had plugged my phone into my computer several times; I remember copying some songs in iTunes. This makes me think that I should be able to synch without reentering the passcode, but unfortunately, that does not seem to work (other sites said that if I plugged it into a computer it had been plugged into before that it would work).
-
Is there any way to incorporate elements from the 2006 namespace in an application that uses the 2
I have a desktop app built in AIR using the 2009 namespace. Is there any way to incorporate any of the of the xmlns:mx="http://www.adobe.com/2006/mxml" components into it?
Or better yet, since the AIR namespace is sort of layered on top of the spark namespace, is it possible to do the same with the 2006 namespace?xmlns:mx="library://ns.adobe.com/flex/mx" is the spark mx address, which is completely different than the original 2006 mx library.
The thing is: I love AIR, hate spark, loved the 2006 pre-spark functionality. It is so much more convenient and user friendly. Given the choice between having the display seperate from the processing, or having it be convenient and easy to work with, I choose the later option.
For the most part it seems like the AIR api is like a layer on top of the spark - flex system.. I would like to be able to over lay the same AIR functionality on top of the the old system....
Possible or no? -
Get keypresses from SVGForm with only label components.
I have a Screen class, extending SVGFORM, with only labels in it.No buttons or spinners and the like.
The SVGForm is displayed and on clock ticks, I change the label strings (telling time). So no input facilities.
The SVGForm has commands, Exit and pause.
The SVGForm is on its own thread, being Runnable.
all works nicely, but:
I need to act on the user pressing the "FIRE" button of the handset.
How can I get at the key code ?
keyPressed() does not catch it, somehow...
one more:
I put the SVGForm on its own thread. The program starts with a splash screen, then an input form to get some variables and then the clock screen starts and keeps running, that being the sole purpose of the program. When the clock is stopped , the program may exit. Is a separate thread for it necessary/a good idea ? or shouldn't I be bothered with threads at all ?Thanks for the reply
I have ended up with something that seems to be working finally.. it's very inspired by robotlegs probably.. I found the SQLite robot-legs-addressbook example extremely helpful and borrowed large swaths of code from it; it was really tricky for me to figure exactly what was doing what (especially because I wasn't aware yet of some of the finer points of debug mode and that thing where you cmd+click and it goes right to the function definition).. I got it working by adding handlers as arguments to the add/update/modify functions..
in the model:
private var _doneAddHandler:Function;
public function add(doneAddHandler:Function):void {
var stmt:String = new String();
_doneAddHandler = doneAddHandler;
//etc
private function add_result(results:Vector.<SQLResult>):void
_doneAddHandler();
then in the component:
public function loadExercise():void {
_exercise.loadExercise(currentUser, DateTime, doneLoadExercise);
That is allowing me to grab the info I need from the database and dump it into the component and back and forth. Probably a little less decoupled than robotlegs.. which I was looking at a bit based on its use in SQLRunner and addressbook, and was quite tempted, but I was on a tight timeline and it seemed very daunting up front; I didn't find a strong enough handhold on it, even though on paper it seemed like exactly the solution to my problems.
I will have to write model classes for some specific views to get the basic information out, but now that communication's going on everything seems a lot more attainable. -
DBcheck get failed from db13 with error BR0301E SQL error -1031
Hi,
I am executing DBcheck from db13 but it gets failed with error "BR0301E SQL error -1031 at location BrDbdiffRead-1, SQL statement".
Here is the job logs:
Job started
Step 001 started (program RSDBAJOB, variant &0000000000424, user ID SVKM_BASIS2)
Execute logical command BRCONNECT On host svkmeccdbci
Parameters: -u / -jid CHECK20110930103211 -c -f check
BR0801I BRCONNECT 7.00 (40)
BR0477I Oracle pfile /oracle/SEP/102_64/dbs/initSEP.ora created from spfile /oracle/SEP/102_64/dbs/spfileSEP.ora
BR0805I Start of BRCONNECT processing: cegwudvg.chk 2011-09-30 10.32.12
BR0484I BRCONNECT log file: /oracle/SEP/sapcheck/cegwudvg.chk
BR0280I BRCONNECT time stamp: 2011-09-30 10.32.12
BR0813I Schema owners found in database SEP:
DBSNMP, DIP, OPS$ORASEP, OPS$SAPSERVICESEP, OPS$SEPADM, ORACLE_OCM, OUTLN, SAPSR3*, SYS, SYSTEM,
TSMSYS
BR0280I BRCONNECT time stamp: 2011-09-30 10.32.20
BR0814I Number of tables in schema of owner SAPSR3: 77207
BR0836I Number of info cube tables found for owner SAPSR3: 49
BR0814I Number of tables/partitions in schema of owner SYS: 625/189
BR0814I Number of tables/partitions in schema of owner SYSTEM: 134/27
BR0280I BRCONNECT time stamp: 2011-09-30 10.32.29
BR0815I Number of indexes in schema of owner SAPSR3: 92099
BR0815I Number of indexes/partitions in schema ofowner SYS: 678/199
BR0815I Number of indexes/partitions in schema ofowner SYSTEM: 175/32
BR0280I BRCONNECT time stamp: 2011-09-30 10.32.52
BR0816I Number of segments in schema of owner DBSNMP: 25
BR0816I Number of segments in schema of owner OPS$SEPADM: 1
BR0816I Number of segments in schema of owner OUTLN: 9
BR0816I Number of segments/LOBs in schema of owner SAPSR3: 174072/2383
BR0816I Number of segments/LOBs in schema of owner SYS: 1838/87
BR0816I Number of segments/LOBs in schema of owner SYSTEM: 353/22
BR0816I Number of segments in schema of owner TSMSYS: 4
BR0280I BRCONNECT time stamp: 2011-09-30 10.32.52
BR0961I Number of conditions found in DBCHECKORA:118
BR0280I BRCONNECT time stamp: 2011-09-30 10.32.52
BR0301E SQL error -1031 at location BrDbdiffRead-1, SQL statement:
'PREPARE stmt_5 STATEMENT FROM'
'SELECT OBJNAME FROM "SAPSR3".DBDIFF WHERE DBSYS IN ('ORACLE', ' ') AND OBJTYPE = 'TABL' AND DIFFKIND IN ('02', '61', '99') ORDE
ORA-01031: insufficient privileges
BR0806I End of BRCONNECT processing: cegwudvg.chk2011-09-30 10.32.52
BR0280I BRCONNECT time stamp: 2011-09-30 10.32.52
BR0804I BRCONNECT terminated with errors
External program terminated with exit code 3
BRCONNECT returned error status E
Job finished
Please help.
Thanks in advanced.
OceanDear,
Thanks for the reply.
I have checked the note you have mention, but it show it is for SAP Release 6.20 or lower.
we have ECC6 EHP4 release 700.
So, please advise, should i go for that note and perform the required action ?
Thanks.
Maybe you are looking for
-
My CD player is not working. when I insert a CD nothing happens.
-
Front facing camera doesn't work
The camera stopped working..screen stays black regardless whether it is on video, front or rear facing camera.. Help
-
How to create cutom authorisation group for custom table?
Hi, I created once custom table. i want to allow only some users to create entries. how can i achieve this? if with creation of z authorisation group tell me procedure thanks in advance.
-
10.8 Printer Orientation Problem (Landscape and Portrait)
I recently upgraded from 10.6 to 10.8 and am using a DS40 Dye Sub printer for event green screen photography. The software is Photokey 5 pro. The printer orientation worked fine with 10.6 providing landscape orientation prints perfectly. With 10.8
-
Transaction to execute the Web Application Designer
Hello, Is there a transaction to execute the Web Application Designer? (In the same was that RRMX executes the BEX Analyzer. thanks, Allan