Jump to content

Programitc Element names


ASTDan

Recommended Posts

Hello,

 

Is there a way to create programmatic element names i.e. element names defined at run time not edit time.

 

For example I have data that I want to associate to it's location i.e. station 1, station 2, etc. I only know how many stations I have at run time.

 

I would like the stations to appear as columns in an xml table in excel. The way I think to do this is to define element names at run time.

 

I think I need something like the following.

 

<Current_Data>

<Station_1>1</Station_1>

<Station_2>2</Station_2>

<Station_3>3</Station_3>

<Station_4>4</Station_4>

<Station_5>5</Station_5>

 

The number of stations are unknown and they may not be sequential.

 

Any help would be appreciated.

 

Thanks

 

Dan

Link to comment
Share on other sites

Hello,

 

Is there a way to create programmatic element names i.e. element names defined at run time not edit time.

 

For example I have data that I want to associate to it's location i.e. station 1, station 2, etc. I only know how many stations I have at run time.

 

I would like the stations to appear as columns in an xml table in excel. The way I think to do this is to define element names at run time.

 

I think I need something like the following.

 

1

2

3

4

5

 

The number of stations are unknown and they may not be sequential.

 

Any help would be appreciated.

 

Thanks

 

Dan

 

Hey Dan,

 

What are the requirements (in terms of XML data structure) of an Excel XML Table?

 

Also, there are a few ways to represent ordered arrays of data. Here's one way to do it (using an attribute to store the station number):

 

1

2

3

 

If you really want to use the exact XML schema you showed, then you'll need to use a Variant representation of your cluster and construct its elements and their names dynamically (e.g. using the OpenG LabVIEW Data Tools library for variant manipulation).

 

-Jim

Link to comment
Share on other sites

Hey Dan,

 

What are the requirements (in terms of XML data structure) of an Excel XML Table?

 

Also, there are a few ways to represent ordered arrays of data. Here's one way to do it (using an attribute to store the station number):

 

<Current_Data Station="1">1</Current_Data>

<Current_Data Station="2">2</Current_Data>

<Current_Data Station="3">3</Current_Data>

 

If you really want to use the exact XML schema you showed, then you'll need to use a Variant representation of your cluster and construct its elements and their names dynamically (e.g. using the OpenG LabVIEW Data Tools library for variant manipulation).

 

-Jim

 

Thanks for the Reply Jim,

 

The requirements are I want my customer to use XML because I think they need it. They want a file that looks warm and fuzzy in excel, because excel is all they know. Down the road when they have 80 gazillion xml files, porting the xml data to data base will be a snap (which I think would be cool). I am trying to figure out a data structure using the Easy XML toolkit that would satisfy both wayward engineers.

 

I tried the attribute. Cool, but didn't quite work.

 

How do I make Variant representation of cluster and construct its elements and their names dynamically? I have the OpenG LabVIEW Data tools Library. What functions would allow me to do this?

 

Thanks

 

Dan

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.