writing XML using nested tables...

I am having difficulties maintaining table relationships when writing
XML files, despite having set the relations property NESTED to TRUE. 
I assume therefore that something is wrong with my code.  Can anyone
help?

CODE
====
While xmlReader.Read()

  'add row to tool table

  nRow = ScanResult1.Tool.NewToolRow()
  nRow("out_tlname") = xmlReader.GetAttribute("tlName")
  ScanResult1.Tool.AddToolRow(nRow)

  ' add row to toolinstance table

  nRow = ScanResult1.ToolInstance.NewRow()
  nRow("out_tliPath") = xmlReader.GetAttribute("tlExec")
  ScanResult1.ToolInstance.AddToolInstanceRow(mRow)

End While

ScanResult1.WriteXml("c:\temp\test.xml")

       
Generated XML file: (ToolInstance should be nested...)
======================================================
<?xml version="1.0" standalone="yes"?>
<ScanResult xmlns="http://tempuri.org/ScanResult.xsd">
  <Tool out_tlname="XXXXX" />
  <Tool out_tlname="YYYYY" />
  <Tool out_tlname="ZZZZZ" />
  <ToolInstance out_tliPath="XX_A" />
  <ToolInstance out_tliPath="YY_B" />
  <ToolInstance out_tliPath="ZZ_C" />
</ScanResult>


XML Schema:
===========
<xs:element name="Tool" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="ToolInstance">
                <xs:complexType>
                    <xs:sequence>
                    </xs:sequence>
                    <xs:attribute name="out_tliPath" type="xs:string"
/>
                    <xs:attribute name="out_tliStatus"
type="xs:string" />
                </xs:complexType>
            </xs:element>
        </xs:sequence>
        <xs:attribute name="out_tlname" type="xs:string" />
        <xs:attribute name="out_tlStatus" type="xs:string" />
    </xs:complexType>
</xs:element>
0
cbirmele (1)
12/26/2003 5:30:24 AM
dotnet.xml 7266 articles. 0 followers. Follow

0 Replies
860 Views

Similar Articles

[PageSpeed] 55

Reply:

Similar Artilces:

Use of Cancel In Unload Event
I have this code in a forms unload event. (V_Password is a Public Variable) My purpose is to prevent the user from exiting the application using any method I do not approve of. (Such as X control button, etc. My reason for this is that the application runs continously in the background, no user input is required. However, if it isn't running due to some user closing it, it won't do what it is supposed to!) Of course I want to have a way out myself, so If I have the password, I can exit. Private Sub Form_Unload(Cancel As Integer) DoCmd.OpenForm "PasswordFo...

XML Custom serialization
Hi all, I want to serialize a class in a customized way. But I don't want to implement the ISerializable interafce because I don't want to take care of every new field I insert to the class. What I need is a way to customize the serialization of a specific field in my class but leave the rest to the build-in serialization. Any guidance will be appreciated. Ro'ee <sfa.roy@gmail.com> wrote in message news:7243a1eb-3fa3-43e0-8339-d90f890e6716@b1g2000hsg.googlegroups.com... > Hi all, > > I want to serialize a class in a customized way. But I don't want to >...

Is there a way for Windows Service to Read/Write HKCU Reg key ?
Hi: I'm writing a Windows Service program which needs to read/write the HKEY_CURRENT_USER registry key for the current logged on user. I know that for a Windows service does not have concept of HKCU since it is always running in SYSTEM's context. But is there a way (trick?) for a service to access the HKCU registry key? Thanks In Advance ! Polaris Hello Try, from a user application (the one that is logged on, or the current user), to send the services the user's SID. Then access the HKCU through HKEY_USERS\users_sid\............ Hope that helps, Elias "Polaris&qu...

Pivot Table Help
I have a column for the actual date and a column for a grade. I hav created a pivot table to total up information in regards to this data. I need to sum up the amounts by the month not the individual day. However I need to keep the individual date as mm/dd/yy. Is there a way that I can manipulate the pivot table to sum up based o the month only? Date 1/2/04 1/3/04 ... 5/6/04 Grade 2 1 ... 5 The pivot table works ok however I really only need to sum up th totals for each month not for each particular day. Is there a way tha I can use the same day column but only calculate the totals...

How to use windows xp chart wizard to add secondary axis
previous posts unhelpful inserting chart with x values in a2:a11 and y(x) values in b2:b11 plotting y(x) versus x TIME FOR USER-DEFINED CHARTING!!! first, select the data you want to put in the chart, then click th chart wizard. Click the "Custom types" tab, then scroll down to th "Line-Column on 2 Axes". it should be a cinch from there. hope this is what you need -- medicenpringle ----------------------------------------------------------------------- medicenpringles's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1645 View this thread...

Write
I am trying to change the default margins. I am requested to use the Write mode to do this. What is Write, and how do I access it? Are you using voice recognition? Margins are simply changed in the Arrange Menu in Publisher. Are you in the right newsgroup? -- Mary Sauer MS MVP http://office.microsoft.com/ http://www.mvps.org/msauer/ news://msnews.microsoft.com "CBC" <anonymous@discussions.microsoft.com> wrote in message news:183bb01c44a40$107bd5d0$a501280a@phx.gbl... > I am trying to change the default margins. I am requested > to use the Write mode to do this. W...

CSV to XML, now to validate
hiya, I have a 3rd party function that converts a CSV to an XML doc. I now need to validate the xmlDoc.I understand that I need a valid XSD for the newly created xmlDoc, but the xmlDoc contains no schema definitions etc.I'm not sure how to create an XSD, so that the fields are restricted to "integer" datatypes etc. Been looking for a while.I assume that I don't have to manually write an XSD?maybe I should create a "dummy" table in sqlServer, then generate a dataset to get the XSD?Or, maybe vis studio 2003 has tools to make this easier? Any suggestions appreciated...

how to detect which macros are no longer in use?
Hi all, Over the years I created a lot of macros, some in modules of certain "normal" xls files, others in my personal.xls. In some cases there are more than macro in one module. I use XP and Excel 2000. Only "normal" modules are used. Some procedures call other macros which are not necessarily in the same module. I want to get rid of macros I don't need, but need a method (a macro?) that shows me wether a macro is called for in one or more other macros and also shows me which macros they are. I have no idea how to accomplish this. Your help will be much appreciated....

Spam filtering using headers: possible?
Hi, My ISP has a spam rating system whereby it inserts a header into the mail like "x-me spamrating: high" I can't find a way to create rules based on headers - is it possible in Outlook 2003? -- Regards Jon Yes, there's a "with specific words in the message header" criteria in the Rules Wizard. "Jon" <spam@jonparker.plus.com> wrote in message news:MPG.1eaaa2fd53db756298a012@text.usenet.plus.net... > Hi, > > My ISP has a spam rating system whereby it inserts a header into the > mail like "x-me spamrating: high" > >...

Use Same Parameter For Different Fields Within Query?
I'm trying to build a query which asks for one parameter "SEARCH TERM", and locates records from one table, where the string "SEARCH TERM" is found anywhere within any of three fields. ie. Product List - Has Product Code, Name and Description fields. I would like one parameter box to be displayed and have it search all three fields within the table to return any records that meet the criteria. Any suggestions would be appreciated. Dan Walters You can reuse the parameter under different fields. In the Criteria row under the first field, enter: Like "*&q...

Using names in a formula
Hi, I used Excel a lot some years ago and now need to use it again (Excel2000) and can't figure out how to do something that was really useful. The situation: 'Budget' worksheet has month names in the top row and account numbers in the left column. I have selected all cells and Created Names with TopRow and Left Column selected. 'Reports' worksheet has month names in the top row and account names in the left column, but not necessarily in the same relative position as in the Budget worksheet. A formula such as =May Bank_Charges (where May and Bank_Charges are names) ret...

Using XSLT to Append Attributes to an XSD File
I wrote an application to scrape a database and create an XSD file which will be annotated by a map file in order to create a Typed DataSet. I was wondering if I could do the annotation using XSLT. Here is background on Typed DataSet: Using Annotations with a Typed DataSet http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconUsingAnnotationsWithTypedDataSet.asp I need to append an attribute a specific XML node. Change <xs:element name="column_1" msdata:ReadOnly="true" minOccurs="0" type="xs:short" /> ...

Writing formula for excel worksheet
Item Rate1 Rate2 Rate3 A 3 4 6 B 8 5 23 C 56 5 78 Above is my excel sheet. I want to write some formula so that in every row cell having minimum rate should come bold. Like For Item A - Rate1(3) for Item B - Rate2(5) For Item C - Rate2 (5) There may be a neater way but this works. Somewhere in you sheet in a cell type =min(A1:a4), I used L1 Change this to watever range you are trying to evaluate. Then select this range and click format - conditional format - cell value - is equal to =($L$1) and apply your bold font. The lowest value in the range will then become bold. Mike "Gaur...

write protect/write redirect/kios mode
Hey, I LOVE snapshots in virtualmachines and think it would be awesome to have something like this for my main windows install. Anyone know of any hardware/software to redirect writes to another drive/file/memory/hardware? Or hardware to write protect a drive for kios's (i found some once befor the reverted all changes on shutdown, but cant find it anymore ><) I know VSS(virtual shadow copy service) has a function to redirect on write and wondering if i might be able to use that :/ It will just make everything cleaner, and give alot of flexiblity to setting up ...

XSLT: Creating anchors from outer XML files
Hi, I'm trying to put the links (href attribute of the <a> element) out of my XSLT files, in a XML file, and read it from the stylesheet. I suppose that I have to use the document() function to link to the XML file containing the URLs, but I don't know how to do it. I've tried something like this: This is XML file containing the URLs (link.xml): <?xml version="1.0" encoding="utf-8" ?> <LINKS> <L1> /SomePage.aspx </L1> </LINKS> And this is the code from the stylesheet: <a href="{document('link.xml')/L...

Cannot write to memory location
I can not (all of the sudden) run Publisher in the last week. When starting to run it, I get that it cannot write to a certain memory locaiton, so it is shutting down. I need to get this program working. I have read through this forum and tried the different fixes as well as the knowledge base (emptied the temp file, disabled anti-virus, etc.) but it still won't work. An example is: "The instruction at "0x77f585c0" referenced memory at "0x00000000". the memory could not be "written". Click on OK to terminate the program." The header read...

how do i write checkbox to.....
This is a multi-part message in MIME format. --------------050607000103070200020407 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit how do i write checkbox1 boolean to xml in vb6 i can only do cstr( checkbox1.value) but in vb.net can't write to xml. i am doing irc chat similar to mirc or pirch chat. rw.WriteConfigInfo("User Modes", chkInvisible.Text, chkInvisible.Checked, "PirateChat.xml") in procedure events: ' Both the Key and the Value are filled ' Find the key ...

Using TaskDialogIndirect is Causing an Access Violation in MFC
When trying to use TaskDialogIndirect with a callback in MFC, the application performs an access violation in wincore.cpp on line 425. This is using VisualStudio 2005 SP1 with Vista updates. "6XGate" <6XGate@discussions.microsoft.com> wrote in message news:A136A6FD-0AD0-472C-B5B1-9217D1B48A34@microsoft.com... > When trying to use TaskDialogIndirect with a callback in MFC, the > application > performs an access violation in wincore.cpp on line 425. > > This is using VisualStudio 2005 SP1 with Vista updates. Show your code and the callstack when it crashes. ...

Need to use VBA to put image on a form
Hello folks, I need to have an event-fired sub put an image on a form. It needs to be fired when the form is advanced to the next record. I don't know how to code it. Thanks -- Earl Kiosterud www.smokeylake.com I think that was a bit too terse. The image I want to put on the form is a jpg image, the file name of which I'll be able to get from a field in the record in the associated table. There's an image for each record. -- Earl Kiosterud www.smokeylake.com Note: Some folks prefer bottom-posting. But if you bottom-post to a reply that's already top...

Internet explorer is very slow in opening Excel Pivot Table lists
i created a small Pivot Table (using less than 1 MB of source data contained in the same file). i saved the file as a Web Page and opted for Pivot Table functionality for the Table. i was able to open the resultant htm file and navigate through the data pretty quickly and easily. The next day, i opened that same htm file, but this time MSIE was VERY slow. My CPU usage went up to a 100% for more than a minute before i got any response on my MSIE. Then i was able to navigate the data, but very slowly. MSIE would go into the "Not responding" mode. The htm file and the suppo...

xml to flat file
Hi. Is there any way of using an xml schema file to a. validate the xml data then writing the xml out as a flat flat. For example in the schema it would say the element has a maximum length of 10 characters and therefore when it is written out as text the value is 10 characters ? <field1>hello</field1> <field2>all</field2> flat file would be hello_____all thanks ...

Extend the XML Schema via C# objects
I have C# objects/entities (like person or customer) which contains the usual amount properties/attributes like name, address and so on.. I would like to "tag" some of these properties, so that when I'm generating and XML Schema (via Wsdl for instance) the tags are displayed in the Schema portion of the Wsdl. Something like the following snippet: <?xml version="1.0" encoding="utf-8"?> <xs:scheme attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" ...

Using Countif with multiple criteria in the same column.
I need to count different criteria from the same column. For example, under the column Names, the criteria for one breakout might be Tom, Beth, John, Roger; the next breakout might be Joe, Sue, Randy, Bob. Assuming you want a count of "Ted" plus "Bob" you could use a formula similar to this. =COUNTIF(C14:C19,"Ted")+COUNTIF(C14:C19,"Bob") -- rsenn ------------------------------------------------------------------------ rsenn's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=29050 View this thread: http://www.excelfor...

Write access to a LDAP server.
Is there any way to enable write access in Outlook to my LDAP server? The LDAP server allows this functionality, Outlook doesn't. Any plugins that can do this? Thanks. Derek ...

Copy setup tables to different great plains version
Hi, There is a techknowledge (KB872709) wherein you can copy setup tables from one company to another in Great Plains. Can I use this if the Great Plains version is different? I'll transfer the setup tables from Great Plains 6 to Great Plains 9. Or should I extract the data from Great Plains 6 then use Integration Manager to integrate it to Great Plains 9? Thanks, Mel It's difficult to give a blanket yes or no answer. You would need to compare the fields from table to table to determine if there are changes. For example, GL definitely has additional fields so you couldn't...