<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: How do you acces secondary datasources</title><link>https://www.infopathdev.com:443/forums/thread/14210.aspx</link><pubDate>Mon, 16 Jan 2006 17:07:42 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14210</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14210.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14210</wfw:commentRss><description>No problem, glad you got things working.  I'll talk to the team about a HowTo concerning namespaces.  There are several already on the web and the W3C has a great tutorial regarding this matter. However, it is not specific to InfoPath.&lt;br /&gt;&lt;br /&lt;a target="_blank" href=http://www.w3schools.com/xml/xml_namespaces.asp&gt;http://www.w3schools.com/xml/xml_namespaces.asp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;InfoPath Dev Texas&lt;br /&gt;</description></item><item><title>Re: How do you acces secondary datasources</title><link>https://www.infopathdev.com:443/forums/thread/14209.aspx</link><pubDate>Mon, 16 Jan 2006 13:48:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14209</guid><dc:creator>Thomas</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14209.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14209</wfw:commentRss><description>Hi Matt - thanks for the help, it worked.&lt;br /&gt;&lt;br /&gt;I did notice that line of code you mention, but I did not connect the "Vehicles" string in the code with name of the secondary data source. Also, the XDocument.GetDOM(...) only seems to work for secondary data sources. I tried it with "Main" and it returned null. To get the data source for the loaded document you have to use the XDocument.DOM property.&lt;br /&gt;&lt;br /&gt;Another thing which has tricked me is the namespace issues when making lookups. My XPath queries into the DOMs did not work until I added a namespace prefix to the queries like this:&lt;br /&gt;&lt;br /&gt;    // Source nodes&lt;br /&gt;    var srcLines = domSrc.selectNodes("/src:Summary/src:line");&lt;br /&gt;&lt;br /&gt;The code above only works if the start of the script contains the following namespace definitions. I left out some of the namespaces for brevity:&lt;br /&gt;&lt;br /&gt;//&amp;lt;namespacesDefinition&amp;gt;&lt;br /&gt;XDocument.DOM.setProperty("SelectionNamespaces",'... xmlns:src="schema1" ... ');&lt;br /&gt;XDocument.GetDOM("PrintSummary").setProperty("SelectionNamespaces", ' ... xmlns:dest="schema2" ... ');&lt;br /&gt;//&amp;lt;/namespacesDefinition&amp;gt;&lt;br /&gt;&lt;br /&gt;The DOM for my secondary data source is accessed by the name "PrintSummary".&lt;br /&gt;&lt;br /&gt;If you guys have the time I think an article concerning the subject above would help a lot of people.&lt;br /&gt;&lt;br /&gt;Thanks again for the tip.&lt;br /&gt;&lt;br /&gt;Thomas</description></item><item><title>Re: How do you acces secondary datasources</title><link>https://www.infopathdev.com:443/forums/thread/14208.aspx</link><pubDate>Fri, 13 Jan 2006 16:44:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14208</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14208.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14208</wfw:commentRss><description>Glad to hear the article is helping you out! Making those print views can be a monstrous task sometimes.&lt;br /&gt;&lt;br /&gt;To access the DOM of the secondary data source you should be able to use a command like this:&lt;br /&gt;&lt;br /&gt;XDocument.GetDOM( "NAME OF SECONDARY DATA SOURCE" );&lt;br /&gt;&lt;br /&gt;This is in the code in the article about 13 lines down. You'll just have to modify it to match your schema.  Let us know if you have any more problems! Good luck!&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;InfoPath Dev Texas&lt;br /&gt;</description></item><item><title>How do you acces secondary datasources</title><link>https://www.infopathdev.com:443/forums/thread/12744.aspx</link><pubDate>Fri, 13 Jan 2006 15:19:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12744</guid><dc:creator>Thomas</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12744.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12744</wfw:commentRss><description>Hi there - I am trying to create a "print view" using the recipe provided in Matts article.&lt;br /&gt;&lt;br /&gt;I have a template whoose layout is already governed by an XML Schema definition (Schema1). Following the steps in the article I create an extra sample XML document whoose structure follows the structure required by the print view. I import this document as a secondary datasource and have the print view use it. Infopath itself is creating a schema for this (Schema2). &lt;br /&gt;&lt;br /&gt;So far so good.&lt;br /&gt;&lt;br /&gt;The task is now - when the print view is selected - to transform the data loaded (following Schema1) to a structure that fits the schema for the print view (Schema2) and put it into the secondary datasource used by the print view. &lt;br /&gt;&lt;br /&gt;However, I cannot figure out how to access the DOM of the data underlying the print view. The DOM property of XDocument contains the DOM tree for the main data (schema1).&lt;br /&gt;&lt;br /&gt;Does anyone know what I am doing wrong?&lt;br /&gt;&lt;br /&gt;Cheers&lt;br /&gt;Thomas</description></item></channel></rss>