Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / August 2007

Tip: Looking for answers? Try searching our database.

Cognos XML-Schema - How to read?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chuck Vance - 26 Aug 2007 21:08 GMT
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"

-->
   <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>
Martin Honnen - 27 Aug 2007 12:05 GMT
> I can't handle this XML-Schema (below)

What you show below is an XML instance document, not an XML schema.

> 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/).

Signature

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

Chuck Vance - 29 Aug 2007 23:48 GMT
>> 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.

> 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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.