473,406 Members | 2,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to access the node in xml

I have an xml file named Trees.xml.
now the xml file is as below
<////////xml///////>
<report xmlns="http://developer.cognos.com/schemas/impromptu/report/1.0/" timeStamp="4652E450" schemaVersion="1.0" fileFormat="3E7A">

+<header>
+<layoutSpec>
-<queries>
-<query isTemplate="no" type="power">
<name/>
+<columns>
- <filters>
- <detail>
- <expression>
<name>New Expression</name>
<type>detail_filter</type>
<dataType>boolean</dataType>
ColumnRef["GOS"."PRODUCT_MULTILINGUAL"."PRODUCT_NAME"] starts with "I"
</expression>
</detail>
</filters>

<////////////xml////////////>


I have loaded the file into an object xml_document as declared below.

</////////code/////////////>
Dim xml_document As DOMDocument30

Set xml_document = New DOMDocument30
xml_document.Load App.path & "Trees.xml"



How can i access the filter expression(ColumnRef["GOS"."PRODUCT_MULTILINGUAL"."PRODUCT_NAME"] starts with "I" ) using the object xml_document. I gave it as
<************************************>
Set getFilterNode = xml_document.selectNodes("/report/queries/query/filter/detail/expression")
MsgBox "filter" & getFilterNode.Item(0).Text
<************************************>

but nothing is getting displayed
May 23 '07 #1
3 2044
dorinbogdan
839 Expert 512MB
Welcome to TheScripts TSDN....

If I see correctly the XML (filters instead of filter), try:
"/report/queries/query/filters/detail/expression"
May 23 '07 #2
Hi,

I am also new to xslt. I am also facing the same issue.

I have a xml file.

<?xml version="1.0" encoding="iso-8859-1" ?>
<report xmlns="http://developer.cognos.com/schemas/impromptu/report/1.0/" timeStamp="46A88410" schemaVersion="1.0" fileFormat="3E71"><header><type>template</type>
<name>/apps/dw/devl/pscognosr4/ReportStore/F_FM/apps/fm_dev.imr</name>
<catalog><name>/apps/dw/devl/pscognosr4/ReportStore/F_FM/apps/fmdev.cat</name>
<database>fmdwr4d</database>
</catalog>
<appVersion>7.1.821.0 UDA-SX-ML-7.5-WIP-23912-0.23912</appVersion>
</header>

xml file is having report tag with attributes. when i try to match report tag it does not matches.

Here is the syntax:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://developer.cognos.com/schemas/impromptu/report/1.0
/" version="1.0">
<xsl:output method="xml"/>

<xsl:template match="report">

But when I remove attributes from report tag from xml file and then run xslt it matches.

Please tell me, how can i match report tag with attributes through xslt.

Thanks,
Sachin






I have an xml file named Trees.xml.
now the xml file is as below
<////////xml///////>
<report xmlns="http://developer.cognos.com/schemas/impromptu/report/1.0/" timeStamp="4652E450" schemaVersion="1.0" fileFormat="3E7A">

+<header>
+<layoutSpec>
-<queries>
-<query isTemplate="no" type="power">
<name/>
+<columns>
- <filters>
- <detail>
- <expression>
<name>New Expression</name>
<type>detail_filter</type>
<dataType>boolean</dataType>
ColumnRef["GOS"."PRODUCT_MULTILINGUAL"."PRODUCT_NAME"] starts with "I"
</expression>
</detail>
</filters>

<////////////xml////////////>


I have loaded the file into an object xml_document as declared below.

</////////code/////////////>
Dim xml_document As DOMDocument30

Set xml_document = New DOMDocument30
xml_document.Load App.path & "Trees.xml"



How can i access the filter expression(ColumnRef["GOS"."PRODUCT_MULTILINGUAL"."PRODUCT_NAME"] starts with "I" ) using the object xml_document. I gave it as
<************************************>
Set getFilterNode = xml_document.selectNodes("/report/queries/query/filter/detail/expression")
MsgBox "filter" & getFilterNode.Item(0).Text
<************************************>

but nothing is getting displayed
Jul 27 '07 #3
jkmyoung
2,057 Expert 2GB
Namespace problem:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://developer.cognos.com/schemas/impromptu/report/1.0/" xmlns:rep="http://developer.cognos.com/schemas/impromptu/report/1.0/" version="1.0">
<xsl:output method="xml"/>

<xsl:template match="rep:report">
Jul 27 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: CoolPint | last post by:
I read in books that nested class cannot access private members of nesting class and vice versa unless they are made friends. Somehow, my compiler is letting my nested class member functions access...
4
by: leodippolito | last post by:
Hello sirs, I am trying to send a POST request to a webservice on the click of a button. This will return me an XML document with a list of combo box items. The problem: in FIREFOX, when the...
3
by: Terry | last post by:
Id like to connect to a table in a different database in the same instance. Create database db1 Create database db2 Connect to db1.... Create table test1 ( Name varchar(10), age INT)
8
by: Martin Marcher | last post by:
Hi, I'm working on a program that creates a linear list of structs struct lin_list{ struct lin_list *next; char Name; }; this is what it looks like. And i got (design) problems with the...
4
by: christopher green | last post by:
I have a solution that comprises a web based project and a console application. Web.Config holds attributes that I want to access from my console application, can anyone advise me as to how to do...
0
by: Jim | last post by:
Hey all, if anyone can help with this I would appreciate it. I'm loading an XML file and modifying one of the nodes. Once I modify the node, I call the .Save method on the XML document object and I...
4
by: MA | last post by:
Hi, How to access the total number of child nodes from a parent node. For example, I would like to get the total number of child nodes from <parent1and <parent2node. The SelectNodes method...
1
by: Chris | last post by:
Hi, I'm using the following code DataTable tables = ((OleDbConnection)oleconn).GetOleDbSchemaTable( OleDbSchemaGuid.Tables, new object { null, null, null, "TABLE" }); foreach (DataRow r in...
4
by: roblenator | last post by:
I am trying to access files on a remote windows server using the following code; my $node = 'server5'; opendir(DIR, '\\$node\C$\Servers') or warn "open failed. reason: $!"; I get an error;...
0
by: p.thorn.ru | last post by:
Hello, I am running db2 express-c 9.5 under linux (fedora 7), and my error log frequently shows messages like these: 2008-01-08-18.30.01.952964+180 I651334G1048 LEVEL: Error (OS) PID ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.