HighTechTalks DotNet Forums  

XML Config File

Dotnet XML microsoft.public.dotnet.xml


Discuss XML Config File in the Dotnet XML forum.



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

Default XML Config File - 06-22-2006 , 10:10 AM






I have about thirteen configuration files that are written in XML. I need to
be able to read and cross reference these files with each other. I have
already written an xsl translator but due to the large size of the file it is
very slow. I have also been unable to access some of the relationships
contained in the document when using xsl. What would be the easiest way to
do this using visual C#? Below is a brief sample from one of the files.

<?xml version="1.0" encoding="utf-8" ?>
<vpmapp>
- <conditionObjects>
<vpm-cat />
<dny-exc a="false" e="" f="false" m="" name="" p="userdefined" />
- <categorylist name="">
<aitem a="sf101" n="" />
<aitem a="sf102" n="" />
<aitem a="sf104" n="" />
</categorylist>
<ipobject name="Clnt IP Address/Subnet3" single="true" type="1" value=""
/>
<ipobject name="SourceIP120" single="true" type="1" value="" />
- <comb-obj d="" n-1="false" n-2="false" name="" t="1">
<c-l-1 n="SourceIP151" />
<c-l-1 n="SourceIP147" />
<c-l-1 n="SourceIP6" />
<c-l-1 n="SourceIP5" />
<c-l-1 n="SourceIP51" />
<c-l-1 n="SourceIP50" />
<c-l-1 n="SourceIP49" />
<c-l-1 n="SourceIP36" />
<c-l-1 n="SourceIP34" />
<c-l-1 n="SourceIP33" />
<c-l-1 n="SourceIP21" />
<c-l-1 n="SourceIP186" />
<c-l-1 n="SourceIP187" />
<c-l-1 n="Clnt IP Address/Subnet3" />
<c-l-1 n="SourceIP120" />
</comb-obj>
<a-url d="" name="URL199" />
<a-url d="" name="URL198" />
<a-url d="" name="URL197" />
<a-url d="" name="URL196" />
<a-url d="" name="URL195" />
<a-url d="" name="URL194" />
<a-url d="" name="URL193" />
<a-url d="" name="URL192" />
<a-url d="" name="URL191" />
<a-url d="" name="URL190" />
<ipobject name="SourceIP99" single="true" type="1" value="" />
<ipobject name="SourceIP98" single="true" type="1" value="" />
<ipobject name="SourceIP97" single="true" type="1" value="" />
<ipobject name="SourceIP96" single="true" type="1" value="" />
<ipobject name="SourceIP95" single="true" type="1" value="" />
- <file-download allow-mime-types="false" name="">
<file-type-info file-extension="" mime-type=""
use-file-extension="true" use-mime-type="false" />
<file-type-info file-extension="" mime-type=""
use-file-extension="true" use-mime-type="false" />
</file-download>
<group delimiters="\!!" group-base="" group-location="" group-prefix=""
group-suffix="" name="" realm-name="" realm-type="4" restrict="" suffix=""
user="false" />
<protocol name="__PROTO_1" subtype="all-im" t="https" />
<group delimiters="\!!" group-base="" group-location="" group-prefix=""
group-suffix="" name="USER44" realm-name="webaccess" realm-type="4"
restrict="false" suffix="false" user="true" />
<group delimiters="\!!" group-base="" group-location="" group-prefix=""
group-suffix="" name="USER45" realm-name="webaccess" realm-type="4"
restrict="false" suffix="false" user="true" />
<group delimiters="\!!" group-base="" group-location="" group-prefix=""
group-suffix="" name="GROUP2" realm-name="webaccess" realm-type="4"
restrict="false" suffix="false" user="false" />
<proxy ip-address="" name="" port="-1" />
<dny-exc a="false" e="user-defined.policy_dend" f="false" m=""
name="LocalPolicyDeny" p="userdefined" />
- <user-agent-list name="">
<user-agent-item description="" name="" user-agent-regex="" />
<user-agent-item description="" name="" user-agent-regex="" />
</user-agent-list>
<adm-auth-obj f="false" name="" r-n="" />
</conditionObjects>
- <layers>
- <layer layertype="">
<name></name>
<numRows>2</numRows>
- <rowItem enabled="true" num="0">
<colItem col="0" value="1" />
<colItem col="1" name="USER14" negate="false" type="Condition" />
<colItem col="2" name="Allow Read-only Access" negate="false"
type="Condition" />
<colItem col="4" name="None" type="String" />
<colItem col="3" name="" type="String" />
</rowItem>
- <rowItem enabled="true" num="1">
<colItem col="0" value="2" />
<colItem col="1" name="USER15" negate="false" type="Condition" />
<colItem col="2" name="Allow Read-only Access" negate="false"
type="Condition" />
<colItem col="4" name="None" type="String" />
<colItem col="3" name="" type="String" />
</rowItem>
</layer>
</layers>
</vpmapp>

Reply With Quote
  #2  
Old   
Zafar Abbas
 
Posts: n/a

Default Re: XML Config File - 06-22-2006 , 12:07 PM






What do you mean when you say you need to cross reference these files. Do
you just need to compare node values across different XML documents? or do
you want to enforce some identity constraints?

Zafar
"ccole" <ccole (AT) discussions (DOT) microsoft.com> wrote

Quote:
I have about thirteen configuration files that are written in XML. I need
to
be able to read and cross reference these files with each other. I have
already written an xsl translator but due to the large size of the file it
is
very slow. I have also been unable to access some of the relationships
contained in the document when using xsl. What would be the easiest way
to
do this using visual C#? Below is a brief sample from one of the files.

?xml version="1.0" encoding="utf-8" ?
vpmapp
- <conditionObjects
vpm-cat /
dny-exc a="false" e="" f="false" m="" name="" p="userdefined" /
- <categorylist name=""
aitem a="sf101" n="" /
aitem a="sf102" n="" /
aitem a="sf104" n="" /
/categorylist
ipobject name="Clnt IP Address/Subnet3" single="true" type="1"
value=""
/
ipobject name="SourceIP120" single="true" type="1" value="" /
- <comb-obj d="" n-1="false" n-2="false" name="" t="1"
c-l-1 n="SourceIP151" /
c-l-1 n="SourceIP147" /
c-l-1 n="SourceIP6" /
c-l-1 n="SourceIP5" /
c-l-1 n="SourceIP51" /
c-l-1 n="SourceIP50" /
c-l-1 n="SourceIP49" /
c-l-1 n="SourceIP36" /
c-l-1 n="SourceIP34" /
c-l-1 n="SourceIP33" /
c-l-1 n="SourceIP21" /
c-l-1 n="SourceIP186" /
c-l-1 n="SourceIP187" /
c-l-1 n="Clnt IP Address/Subnet3" /
c-l-1 n="SourceIP120" /
/comb-obj
a-url d="" name="URL199" /
a-url d="" name="URL198" /
a-url d="" name="URL197" /
a-url d="" name="URL196" /
a-url d="" name="URL195" /
a-url d="" name="URL194" /
a-url d="" name="URL193" /
a-url d="" name="URL192" /
a-url d="" name="URL191" /
a-url d="" name="URL190" /
ipobject name="SourceIP99" single="true" type="1" value="" /
ipobject name="SourceIP98" single="true" type="1" value="" /
ipobject name="SourceIP97" single="true" type="1" value="" /
ipobject name="SourceIP96" single="true" type="1" value="" /
ipobject name="SourceIP95" single="true" type="1" value="" /
- <file-download allow-mime-types="false" name=""
file-type-info file-extension="" mime-type=""
use-file-extension="true" use-mime-type="false" /
file-type-info file-extension="" mime-type=""
use-file-extension="true" use-mime-type="false" /
/file-download
group delimiters="\!!" group-base="" group-location=""
group-prefix=""
group-suffix="" name="" realm-name="" realm-type="4" restrict="" suffix=""
user="false" /
protocol name="__PROTO_1" subtype="all-im" t="https" /
group delimiters="\!!" group-base="" group-location="" group-prefix=""
group-suffix="" name="USER44" realm-name="webaccess" realm-type="4"
restrict="false" suffix="false" user="true" /
group delimiters="\!!" group-base="" group-location=""
group-prefix=""
group-suffix="" name="USER45" realm-name="webaccess" realm-type="4"
restrict="false" suffix="false" user="true" /
group delimiters="\!!" group-base="" group-location=""
group-prefix=""
group-suffix="" name="GROUP2" realm-name="webaccess" realm-type="4"
restrict="false" suffix="false" user="false" /
proxy ip-address="" name="" port="-1" /
dny-exc a="false" e="user-defined.policy_dend" f="false" m=""
name="LocalPolicyDeny" p="userdefined" /
- <user-agent-list name=""
user-agent-item description="" name="" user-agent-regex="" /
user-agent-item description="" name="" user-agent-regex="" /
/user-agent-list
adm-auth-obj f="false" name="" r-n="" /
/conditionObjects
- <layers
- <layer layertype=""
name></name
numRows>2</numRows
- <rowItem enabled="true" num="0"
colItem col="0" value="1" /
colItem col="1" name="USER14" negate="false" type="Condition" /
colItem col="2" name="Allow Read-only Access" negate="false"
type="Condition" /
colItem col="4" name="None" type="String" /
colItem col="3" name="" type="String" /
/rowItem
- <rowItem enabled="true" num="1"
colItem col="0" value="2" /
colItem col="1" name="USER15" negate="false" type="Condition" /
colItem col="2" name="Allow Read-only Access" negate="false"
type="Condition" /
colItem col="4" name="None" type="String" /
colItem col="3" name="" type="String" /
/rowItem
/layer
/layers
/vpmapp



Reply With Quote
  #3  
Old   
ccole
 
Posts: n/a

Default Re: XML Config File - 06-22-2006 , 02:12 PM



I need to be able to compare node values to validate that all machines are
configured the same.

"Zafar Abbas" wrote:

Quote:
What do you mean when you say you need to cross reference these files. Do
you just need to compare node values across different XML documents? or do
you want to enforce some identity constraints?

Zafar
"ccole" <ccole (AT) discussions (DOT) microsoft.com> wrote in message
news:FC149E2A-78BC-4305-93B9-1DA3D5091786 (AT) microsoft (DOT) com...
I have about thirteen configuration files that are written in XML. I need
to
be able to read and cross reference these files with each other. I have
already written an xsl translator but due to the large size of the file it
is
very slow. I have also been unable to access some of the relationships
contained in the document when using xsl. What would be the easiest way
to
do this using visual C#? Below is a brief sample from one of the files.

?xml version="1.0" encoding="utf-8" ?
vpmapp
- <conditionObjects
vpm-cat /
dny-exc a="false" e="" f="false" m="" name="" p="userdefined" /
- <categorylist name=""
aitem a="sf101" n="" /
aitem a="sf102" n="" /
aitem a="sf104" n="" /
/categorylist
ipobject name="Clnt IP Address/Subnet3" single="true" type="1"
value=""
/
ipobject name="SourceIP120" single="true" type="1" value="" /
- <comb-obj d="" n-1="false" n-2="false" name="" t="1"
c-l-1 n="SourceIP151" /
c-l-1 n="SourceIP147" /
c-l-1 n="SourceIP6" /
c-l-1 n="SourceIP5" /
c-l-1 n="SourceIP51" /
c-l-1 n="SourceIP50" /
c-l-1 n="SourceIP49" /
c-l-1 n="SourceIP36" /
c-l-1 n="SourceIP34" /
c-l-1 n="SourceIP33" /
c-l-1 n="SourceIP21" /
c-l-1 n="SourceIP186" /
c-l-1 n="SourceIP187" /
c-l-1 n="Clnt IP Address/Subnet3" /
c-l-1 n="SourceIP120" /
/comb-obj
a-url d="" name="URL199" /
a-url d="" name="URL198" /
a-url d="" name="URL197" /
a-url d="" name="URL196" /
a-url d="" name="URL195" /
a-url d="" name="URL194" /
a-url d="" name="URL193" /
a-url d="" name="URL192" /
a-url d="" name="URL191" /
a-url d="" name="URL190" /
ipobject name="SourceIP99" single="true" type="1" value="" /
ipobject name="SourceIP98" single="true" type="1" value="" /
ipobject name="SourceIP97" single="true" type="1" value="" /
ipobject name="SourceIP96" single="true" type="1" value="" /
ipobject name="SourceIP95" single="true" type="1" value="" /
- <file-download allow-mime-types="false" name=""
file-type-info file-extension="" mime-type=""
use-file-extension="true" use-mime-type="false" /
file-type-info file-extension="" mime-type=""
use-file-extension="true" use-mime-type="false" /
/file-download
group delimiters="\!!" group-base="" group-location=""
group-prefix=""
group-suffix="" name="" realm-name="" realm-type="4" restrict="" suffix=""
user="false" /
protocol name="__PROTO_1" subtype="all-im" t="https" /
group delimiters="\!!" group-base="" group-location="" group-prefix=""
group-suffix="" name="USER44" realm-name="webaccess" realm-type="4"
restrict="false" suffix="false" user="true" /
group delimiters="\!!" group-base="" group-location=""
group-prefix=""
group-suffix="" name="USER45" realm-name="webaccess" realm-type="4"
restrict="false" suffix="false" user="true" /
group delimiters="\!!" group-base="" group-location=""
group-prefix=""
group-suffix="" name="GROUP2" realm-name="webaccess" realm-type="4"
restrict="false" suffix="false" user="false" /
proxy ip-address="" name="" port="-1" /
dny-exc a="false" e="user-defined.policy_dend" f="false" m=""
name="LocalPolicyDeny" p="userdefined" /
- <user-agent-list name=""
user-agent-item description="" name="" user-agent-regex="" /
user-agent-item description="" name="" user-agent-regex="" /
/user-agent-list
adm-auth-obj f="false" name="" r-n="" /
/conditionObjects
- <layers
- <layer layertype=""
name></name
numRows>2</numRows
- <rowItem enabled="true" num="0"
colItem col="0" value="1" /
colItem col="1" name="USER14" negate="false" type="Condition" /
colItem col="2" name="Allow Read-only Access" negate="false"
type="Condition" /
colItem col="4" name="None" type="String" /
colItem col="3" name="" type="String" /
/rowItem
- <rowItem enabled="true" num="1"
colItem col="0" value="2" /
colItem col="1" name="USER15" negate="false" type="Condition" /
colItem col="2" name="Allow Read-only Access" negate="false"
type="Condition" /
colItem col="4" name="None" type="String" /
colItem col="3" name="" type="String" /
/rowItem
/layer
/layers
/vpmapp




Reply With Quote
  #4  
Old   
Priya Lakshminarayanan
 
Posts: n/a

Default Re: XML Config File - 06-22-2006 , 05:20 PM



If you want to diff the xml files, you can take a look at the XML Diff tool
at: http://msdn.microsoft.com/XML/XMLDownloads/default.aspx

Or you can use XmlReader API to read the xml files in a streaming fashion
and compare them in code.

Thanks,
Priya

"ccole" <ccole (AT) discussions (DOT) microsoft.com> wrote

Quote:
I need to be able to compare node values to validate that all machines are
configured the same.

"Zafar Abbas" wrote:

What do you mean when you say you need to cross reference these files.
Do
you just need to compare node values across different XML documents? or
do
you want to enforce some identity constraints?

Zafar
"ccole" <ccole (AT) discussions (DOT) microsoft.com> wrote in message
news:FC149E2A-78BC-4305-93B9-1DA3D5091786 (AT) microsoft (DOT) com...
I have about thirteen configuration files that are written in XML. I
need
to
be able to read and cross reference these files with each other. I
have
already written an xsl translator but due to the large size of the file
it
is
very slow. I have also been unable to access some of the relationships
contained in the document when using xsl. What would be the easiest
way
to
do this using visual C#? Below is a brief sample from one of the
files.

?xml version="1.0" encoding="utf-8" ?
vpmapp
- <conditionObjects
vpm-cat /
dny-exc a="false" e="" f="false" m="" name="" p="userdefined" /
- <categorylist name=""
aitem a="sf101" n="" /
aitem a="sf102" n="" /
aitem a="sf104" n="" /
/categorylist
ipobject name="Clnt IP Address/Subnet3" single="true" type="1"
value=""
/
ipobject name="SourceIP120" single="true" type="1" value="" /
- <comb-obj d="" n-1="false" n-2="false" name="" t="1"
c-l-1 n="SourceIP151" /
c-l-1 n="SourceIP147" /
c-l-1 n="SourceIP6" /
c-l-1 n="SourceIP5" /
c-l-1 n="SourceIP51" /
c-l-1 n="SourceIP50" /
c-l-1 n="SourceIP49" /
c-l-1 n="SourceIP36" /
c-l-1 n="SourceIP34" /
c-l-1 n="SourceIP33" /
c-l-1 n="SourceIP21" /
c-l-1 n="SourceIP186" /
c-l-1 n="SourceIP187" /
c-l-1 n="Clnt IP Address/Subnet3" /
c-l-1 n="SourceIP120" /
/comb-obj
a-url d="" name="URL199" /
a-url d="" name="URL198" /
a-url d="" name="URL197" /
a-url d="" name="URL196" /
a-url d="" name="URL195" /
a-url d="" name="URL194" /
a-url d="" name="URL193" /
a-url d="" name="URL192" /
a-url d="" name="URL191" /
a-url d="" name="URL190" /
ipobject name="SourceIP99" single="true" type="1" value="" /
ipobject name="SourceIP98" single="true" type="1" value="" /
ipobject name="SourceIP97" single="true" type="1" value="" /
ipobject name="SourceIP96" single="true" type="1" value="" /
ipobject name="SourceIP95" single="true" type="1" value="" /
- <file-download allow-mime-types="false" name=""
file-type-info file-extension="" mime-type=""
use-file-extension="true" use-mime-type="false" /
file-type-info file-extension="" mime-type=""
use-file-extension="true" use-mime-type="false" /
/file-download
group delimiters="\!!" group-base="" group-location=""
group-prefix=""
group-suffix="" name="" realm-name="" realm-type="4" restrict=""
suffix=""
user="false" /
protocol name="__PROTO_1" subtype="all-im" t="https" /
group delimiters="\!!" group-base="" group-location=""
group-prefix=""
group-suffix="" name="USER44" realm-name="webaccess" realm-type="4"
restrict="false" suffix="false" user="true" /
group delimiters="\!!" group-base="" group-location=""
group-prefix=""
group-suffix="" name="USER45" realm-name="webaccess" realm-type="4"
restrict="false" suffix="false" user="true" /
group delimiters="\!!" group-base="" group-location=""
group-prefix=""
group-suffix="" name="GROUP2" realm-name="webaccess" realm-type="4"
restrict="false" suffix="false" user="false" /
proxy ip-address="" name="" port="-1" /
dny-exc a="false" e="user-defined.policy_dend" f="false" m=""
name="LocalPolicyDeny" p="userdefined" /
- <user-agent-list name=""
user-agent-item description="" name="" user-agent-regex="" /
user-agent-item description="" name="" user-agent-regex="" /
/user-agent-list
adm-auth-obj f="false" name="" r-n="" /
/conditionObjects
- <layers
- <layer layertype=""
name></name
numRows>2</numRows
- <rowItem enabled="true" num="0"
colItem col="0" value="1" /
colItem col="1" name="USER14" negate="false" type="Condition"
/
colItem col="2" name="Allow Read-only Access" negate="false"
type="Condition" /
colItem col="4" name="None" type="String" /
colItem col="3" name="" type="String" /
/rowItem
- <rowItem enabled="true" num="1"
colItem col="0" value="2" /
colItem col="1" name="USER15" negate="false" type="Condition"
/
colItem col="2" name="Allow Read-only Access" negate="false"
type="Condition" /
colItem col="4" name="None" type="String" /
colItem col="3" name="" type="String" /
/rowItem
/layer
/layers
/vpmapp






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 - 2013, Jelsoft Enterprises Ltd.