From: Brian R. <rog...@gm...> - 2008-08-20 23:17:13
|
Hey Zach, Just curious, could you use the below XPath instead? /hibernate-configuration/session-factory/property[\[]@name='connection.connection_string'[\]] Thanks, -- Brian Rogers "Intelligence removes complexity." - Me http://icumove.spaces.live.com On Wed, Aug 20, 2008 at 2:14 AM, Zachary Young <zac...@en...>wrote: > Hi, > > > > Can someone please verify that XmlConfig uses XPath (and not XSLPattern) > for its query language? > > > > When I run this: > > > > <util:XmlConfig > > Id="Hibernate.Config" > > Action="create" > > ElementPath="//*[\[]local-name()='property' and > namespace-uri()='urn:nhibernate-configuration-2.2'[\]][\[]@name='connect > ion.connection_string'[\]]" > > File="[INSTALLDIR]Configuration\Hibernate.Config.xml" > > On="install" > > Node="value" > > Value="Server=[SERVER];Database=[DBNAME];User > Id=[USERID];Password=[PASSWORD]" > > /> > > > > against this: > > > > <?xml version='1.0' encoding='utf-8'?> > > <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> > > <session-factory> > > <property name="connection.connection_string"></property> > > </session-factory> > > </hibernate-configuration> > > > > I get the following error in my installation log: > > > > ExecXmlConfig: Error 0x80004005: failed to find node: //* in XML file: > D:\Inetpub\services\console\Configuration\Hibernate.Config.xml > > MSI (s) (8C!98) [01:55:10:115]: Product: ConsoleWS.Setup -- Error 25542. > Failed to find node: //*[local-name()='property' and > namespace-uri()='urn:nhibernate-configuration-2.2'][@name='connection.co > nnection_string'] in XML file: > D:\Inetpub\services\console\Configuration\Hibernate.Config.xml, system > error: -2147467259 > > > > Error 25542. Failed to find node: //*[local-name()='property' and > namespace-uri()='urn:nhibernate-configuration-2.2'][@name='connection.co > nnection_string'] in XML file: > D:\Inetpub\services\console\Configuration\Hibernate.Config.xml, system > error: -2147467259 > > > > The above error seems very reminiscent of another problem I was having a > couple of days ago where I was trying this same XPath with the XmlFile > Element. I kept getting the 'failed to find node: //*...' error until I > realized that XmlFile Element was defaulting to XSLPattern. Changing the > ' SelectionLanguage' attribute to 'XPath' fixed the problem immediately. > > > > If I take the XPath from the error message above, I can turn right back > around, load the Hibernate.config file in Chris Lovett's XML Notepad > 2007 and <oXygen/> (using Saxon6.5.4 for XPath 1.0 and Saxon8B for XPath > 2.0) and find the connection 'property' element. I am fairly certain > that it is valid XPath: > > > > //*[local-name()='property' and > namespace-uri()='urn:nhibernate-configuration-2.2'][@name='connection.co > nnection_string'] > > > > Is my XmlConfig configured incorrectly? I'm using WiX 3.0.4415.0. > > > > Thank you, > > Zach > |