I'm not getting a lot of response on this so I'll try to state it more strongly
XmlFile does not work if the xml file has a namespace defined at the root node.
Is this a bug?
Is there some sort of work around with associated Properties?
Example (This does not work)
<?xml version="1.0" encoding="utf-8"?>
<SqlCommandVariables
xmlns="urn:Microsoft.VisualStudio.Data.Schema.Project.SqlCmdVars">
<Version>1</Version>
<Properties>
<Property>
<PropertyName>Path1</PropertyName>
<PropertyValue>C:\</PropertyValue>
</Property>
<Property>
<PropertyName>Path2</PropertyName>
<PropertyValue>C:\Program Files</PropertyValue>
</Property>
<Property>
<PropertyName>Path3</PropertyName>
<PropertyValue>C:\Program Files\Microsoft</PropertyValue>
</Property>
</Properties>
</SqlCommandVariables>
<Component Id="Database.sqlcmdvars"
Guid="{58B4E936-A66D-4C2D-ABE0-CB1610CE880D}" DiskId="1">
<File Id="Database.sqlcmdvars" Name="Database.sqlcmdvars" KeyPath="yes"
Source="$(var.SimpleDatabase.TargetDir)Database.sqlcmdvars" Vital="yes" />
<util:XmlFile Id="SetPath1Variable" Action="setValue"
ElementPath="SqlCommandVariables/Properties/Property[\[]node() =
'Path1'[\]]/PropertyValue" File="[#Database.sqlcmdvars]"
SelectionLanguage="XPath" Value="[LOGPATH]"/>
<util:XmlFile Id="SetPath2Variable" Action="setValue"
ElementPath="SqlCommandVariables/Properties/Property[\[]node() =
'Path2'[\]]/PropertyValue" File="[#Database.sqlcmdvars]"
SelectionLanguage="XPath" Value="[DATAPATH]"/>
<util:XmlFile Id="SetPath3Variable" Action="setValue"
ElementPath="SqlCommandVariables/Properties/Property[\[]node() =
'Path3'[\]]/PropertyValue" File="[#Database.sqlcmdvars]"
SelectionLanguage="XPath" Value="MyPath3"/>
</Component>
In the above example I always get an error
Example Again (This works)
<?xml version="1.0" encoding="utf-8"?>
<SqlCommandVariables>
<Version>1</Version>
<Properties>
<Property>
<PropertyName>Path1</PropertyName>
<PropertyValue>C:\</PropertyValue>
</Property>
<Property>
<PropertyName>Path2</PropertyName>
<PropertyValue>C:\Program Files</PropertyValue>
</Property>
<Property>
<PropertyName>Path3</PropertyName>
<PropertyValue>C:\Program Files\Microsoft</PropertyValue>
</Property>
</Properties>
</SqlCommandVariables>
<Component Id="Database.sqlcmdvars"
Guid="{58B4E936-A66D-4C2D-ABE0-CB1610CE880D}" DiskId="1">
<File Id="Database.sqlcmdvars" Name="Database.sqlcmdvars" KeyPath="yes"
Source="$(var.SimpleDatabase.TargetDir)Database.sqlcmdvars" Vital="yes" />
<util:XmlFile Id="SetPath1Variable" Action="setValue"
ElementPath="SqlCommandVariables/Properties/Property[\[]node() =
'Path1'[\]]/PropertyValue" File="[#Database.sqlcmdvars]"
SelectionLanguage="XPath" Value="[LOGPATH]"/>
<util:XmlFile Id="SetPath2Variable" Action="setValue"
ElementPath="SqlCommandVariables/Properties/Property[\[]node() =
'Path2'[\]]/PropertyValue" File="[#Database.sqlcmdvars]"
SelectionLanguage="XPath" Value="[DATAPATH]"/>
<util:XmlFile Id="SetPath3Variable" Action="setValue"
ElementPath="SqlCommandVariables/Properties/Property[\[]node() =
'Path3'[\]]/PropertyValue" File="[#Database.sqlcmdvars]"
SelectionLanguage="XPath" Value="MyPath3"/>
</Component>
The only difference is the presence of the xmlns attribute on the node.
-----Original Message-----
From: Scott Sharpe [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 16, 2008 10:45 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] XmlFile does not support default namespaces?
Sorry about the clarity.
If my xml file does not have a default namespace. Then XPath queries work just
fine through the XmlFile element.
If my xml file has a default namespace. Then XPath queries do not work.
If this was straight-up XSLT then I would add the default namespace to the
preprocessor. But I don't see a way to do that with XmlFile or XmlConfig.
So I'm wondering if XmlFile supports xml files that have namespaces in their
root element?
-----Original Message-----
From: Bob Arnson [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 15, 2008 2:54 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] XmlFile does not support default namespaces?
Scott Sharpe wrote:
> I'm wanting to update an xml file as part of my install. Works fine as long
> as the root node does not have a default namespace. Is this a known issue?
>
Um, is what a known issue? What happens if it does have a default
namespace? There are definitely some MSXML oddities with them.
--
sig://boB
http://joyofsetup.com/
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users