?
Solved

how to read xml having  diffgr:diffgram

Posted on 2009-12-16
5
Medium Priority
?
2,363 Views
Last Modified: 2013-11-18
Hi ,

I get the below xml file from one site.
I need to get it through

$xmlDoc = new DOMDocument;
$test2=$xmlDoc->load('http://ecommercewebsite.biz/projects/propmgr/xml_test.xml');

now if i wants to get the value of element DOB inside  diffgr:diffgram tag how can i get it?

Please provide me the solution its urgent.

Thanks.
0
Comment
Question by:atulmodi
  • 2
  • 2
5 Comments
 
LVL 3

Expert Comment

by:K4U
ID: 26061573
0
 
LVL 3

Expert Comment

by:K4U
ID: 26061582
0
 

Author Comment

by:atulmodi
ID: 26061814
None of the above solution working.
0
 
LVL 4

Expert Comment

by:aego
ID: 26062065
You have not attached real XML document, and there is no DOB element in SOAP response which you've attached to your previous question. This code for instance provides access to first DSCCVCreditCardTypes element inside of diffgr:diffgram:

$xpath = new DOMXPath($xmlDoc);
$xpath->registerNamespace('diffgr', 'urn:schemas-microsoft-com:xml-diffgram-v1');
$xpath->registerNamespace('bogus', 'http://someurl.xsd');
$diffgr = $xpath->query('//diffgr:diffgram//bogus:DSCCVCreditCardTypes')->item(0);
echo $diffgr->textContent;

You could try to replace DSCCVCreditCardTypes to DOB in this example but it may not work because of possible namespace differences.

If you attach your real XML document with proper structure, I could help to traverse to needed element more clearly.
0
 

Accepted Solution

by:
atulmodi earned 0 total points
ID: 26093598
Hello all,

I tried all above but it is not working.
I used getElementsByTagName() and get the results.

Thanks
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Stellar Exchange Toolkit: this 5 in 1 toolkit comes loaded with mega-software tool. Here’s an introduction to tools’ usage and advantages:
This holiday season, we’re giving away the gift of knowledge—tech knowledge, that is. Keep reading to see what hacks, tips, and trends we have wrapped and waiting for you under the tree.
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses
Course of the Month15 days, 19 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question