Re: Problem displaying XML in a datagrid

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Dino Chiesa [Microsoft] (dinoch_at_online.microsoft.com)
Date: 07/28/04


Date: Tue, 27 Jul 2004 21:17:15 -0400

seems like bad XML.
I would transform it.

to something like
<plugins>
  <plugin flavor="A">
      <property1>...</...>
   </plugin>
    <plugin flavor="B">
       ...
...

But that's just me.

Once you have it in a more reasonable shape, then displaying it in a
datagrid (or loading it into a dataset) is much easier.

-D

"James W" <JamesW@discussions.microsoft.com> wrote in message
news:ABA23B1E-EEB1-42AF-8766-867A84C1AD31@microsoft.com...
> I should mention - I have no experience with XML Schemas, though I suspect
that a schema might solve the problem. Thoughts?
>
> "James W" wrote:
>
> > Hello all,
> >
> > I have some XML that is serialized from a registry hive, and is in the
format:
> >
> > <plugins>
> > <pluginA>
> > <property1>foo</property1>
> > <property2>bar</property2>
> > ...
> > </pluginA>
> > <pluginB>
> > <property1>oof</property1>
> > <property2>rab</property2>
> > ...
> > </pluginB>
> > ....
> > </plugins>
> >
> > The plugin-level nodes are named uniquely and I cannot control their
names or know how many there are. The property nodes have known names and
quantities.
> >
> > I am trying to load this into a dataset for display in a datagrid where
each property is displayed in a column. From what I am able to determine,
doing a SetDataBinding using the plugins node and using property nodes as
DataColumns will only display the first plugin node's properties.
> >
> > My question is, is there a way to tell the datagrid or dataset to
'ignore' the plugin node name differences so that it will display properly?
> >
> > My two possible workarounds are one to transform the xml to standardize
the plugin node names, or to manually crawl the XML, doing a
DataTable.Rows.Add() using the property node names and values. The first
seems easier than the second, but neither is particularly appealing.
> >
> > Anyone know of a way to get a dataset/datagrid to correctly display XML
of the type I have?



Relevant Pages

  • Re: About a plugin framework!
    ... > XML defining the classname and some extra information and the app will be ... The xml stuff unnecessarily complicates things. ... So the name is not enough - unicode or not. ... > Each module (plugin) can have a different class name defined in the XML ...
    (comp.lang.python)
  • Re: Methods to Log snort alerts in XML
    ... if you're interested in IDMEF which in turn is XML based there is an output ... Methods to Log snort alerts in XML ... Do anyone know how to log snort alerts in XML format? ... I tried to use the "Snort XML Output Plugin" produced by Carnegie Mellon's ...
    (Focus-IDS)
  • Re: VB.Net and XML Example
    ... Plug-In\bin\Claims Tool Adjudication Plug-In.dll" ... Here's some semi-crappy code that read the previous XML... ...
    (microsoft.public.dotnet.general)
  • Re: DOMXML get unknown Attributes
    ... > I was wondering how I can get all Attributes of a XML-Tag without ... > knowing them. ... The XML could look like following: ...
    (comp.lang.php)