HighTechTalks DotNet Forums  

Cognos XML-Schema - How to read?

Dotnet XML microsoft.public.dotnet.xml


Discuss Cognos XML-Schema - How to read? in the Dotnet XML forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Chuck Vance
 
Posts: n/a

Default Cognos XML-Schema - How to read? - 08-26-2007 , 04:08 PM






Hi ng,
I can't handle this XML-Schema (below)
I want to access the data like "Select Name from DATA".

<?xml version="1.0" encoding="utf-8"?>
<dataset xmlns="http://developer.cognos.com/schemas/xmldata/1/" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
<!--
<dataset
xmlns="http://developer.cognos.com/schemas/xmldata/1/"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="http://developer.cognos.com/schemas/xmldata/1/ xmldata.xsd"
Quote:
--
<metadata>
<item name="Name" type="xs:string" length="202"/>
<item name="Familyname" type="xs:string" length="102"/>
</metadata>
<data>
<row>
<value>Kohl</value>
<value>Helmut</value>
</row>
<row>
<value>Merkel</value>
<value>Angela</value>
</row>
</data>
</dataset>





Reply With Quote
  #2  
Old   
Martin Honnen
 
Posts: n/a

Default Re: Cognos XML-Schema - How to read? - 08-27-2007 , 07:05 AM






Chuck Vance wrote:

Quote:
I can't handle this XML-Schema (below)
What you show below is an XML instance document, not an XML schema.

Quote:
I want to access the data like "Select Name from DATA".
That is SQL. For XML querying you use XPath e.g.
/xd:dataset/xd:data/xd:row/xd:value
selects all value elements (assuming prefix xd is bound to namespace
http://developer.cognos.com/schemas/xmldata/1/).



--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/


Reply With Quote
  #3  
Old   
Martin Honnen
 
Posts: n/a

Default Re: Cognos XML-Schema - How to read? - 08-27-2007 , 07:05 AM



Chuck Vance wrote:

Quote:
I can't handle this XML-Schema (below)
What you show below is an XML instance document, not an XML schema.

Quote:
I want to access the data like "Select Name from DATA".
That is SQL. For XML querying you use XPath e.g.
/xd:dataset/xd:data/xd:row/xd:value
selects all value elements (assuming prefix xd is bound to namespace
http://developer.cognos.com/schemas/xmldata/1/).



--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/


Reply With Quote
  #4  
Old   
Chuck Vance
 
Posts: n/a

Default Re: Cognos XML-Schema - How to read? - 08-29-2007 , 06:48 PM



Quote:
I can't handle this XML-Schema (below)
What you show below is an XML instance document, not an XML schema.
you exchange the form with the content! It's the schema that problems me.

However this question is about to process the data with built-in .NET-routines without writing own iterative functions.

Quote:
use XPath e.g.
/xd:dataset/xd:data/xd:row/xd:value
selects all value elements (assuming prefix xd is bound to namespace
I tried to read the document with XPath-Methods etc. but I failed to get the information like this:
XMLElement.Name="Familyname"
XMLElement.Value="Merkel"

I can't combine the information inside the XML-document like above.
The field-names are declared - the rows is listed - and the values are defined -
but I haven't yet found the right way to restore the information by a System.XML..Command.

Chuck.




Reply With Quote
  #5  
Old   
Chuck Vance
 
Posts: n/a

Default Re: Cognos XML-Schema - How to read? - 08-29-2007 , 06:48 PM



Quote:
I can't handle this XML-Schema (below)
What you show below is an XML instance document, not an XML schema.
you exchange the form with the content! It's the schema that problems me.

However this question is about to process the data with built-in .NET-routines without writing own iterative functions.

Quote:
use XPath e.g.
/xd:dataset/xd:data/xd:row/xd:value
selects all value elements (assuming prefix xd is bound to namespace
I tried to read the document with XPath-Methods etc. but I failed to get the information like this:
XMLElement.Name="Familyname"
XMLElement.Value="Merkel"

I can't combine the information inside the XML-document like above.
The field-names are declared - the rows is listed - and the values are defined -
but I haven't yet found the right way to restore the information by a System.XML..Command.

Chuck.




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.