<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1041802" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1041802</link>
    <description></description>
    <language>en</language>
          <item>
    <title>New info!
The problem seems</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/replacing-node-php-word-doc-xml#comment-1232875</link>
    <description> &lt;p&gt;New info!&lt;/p&gt;
&lt;p&gt;The problem seems to be with the aml:annotation tag, not recognized somehow with XPATH - (maybe need to use asXML?)&lt;/p&gt;
&lt;p&gt;&lt;code&gt;$text = $tpl-&amp;gt;xpath(&amp;#039;//w:tc/w:p/w:r/w:t&amp;#039;);&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;will produce the text fields&lt;/p&gt;
&lt;p&gt;but the folowing will not:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;$text = $tpl-&amp;gt;xpath(&amp;#039;//aml:annotation/w:tc/w:p/w:r/w:t&amp;#039;);&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I *could* retrieve the text and match it with some text stored as data... but I really want to use the w:name=&quot;a119421&quot; number that corresponds to the S 508 Provision number... which is in aml:annotation since it was a Word Bookmark prior to conversion to XML&lt;/p&gt;
 </description>
     <pubDate>Sat, 30 Aug 2008 20:15:30 +0000</pubDate>
 <dc:creator>decibel.places</dc:creator>
 <guid isPermaLink="false">comment 1232875 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>I found some helpful posts</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/replacing-node-php-word-doc-xml#comment-1232871</link>
    <description> &lt;p&gt;I found some helpful posts about using XPATH with the OpenXML schema and MS Office namespaces..  &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt; &lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://devzone.zend.com/node/view/id/688&quot; title=&quot;http://devzone.zend.com/node/view/id/688&quot;&gt;http://devzone.zend.com/node/view/id/688&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.ibm.com/developerworks/library/x-simplexml.html&quot; title=&quot;http://www.ibm.com/developerworks/library/x-simplexml.html&quot;&gt;http://www.ibm.com/developerworks/library/x-simplexml.html&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://blogs.msdn.com/brian_jones/&quot; title=&quot;http://blogs.msdn.com/brian_jones/&quot;&gt;http://blogs.msdn.com/brian_jones/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This code will return ALL the text nodes in the doc:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;$tpl =&amp;nbsp; simplexml_load_file(&amp;#039;files/templates/laptop_template.xml&amp;#039;);&lt;br /&gt;$tpl-&amp;gt;registerXPathNamespace(&amp;#039;w&amp;#039;, &amp;#039;http://schemas.microsoft.com/office/word/2003/wordml&amp;#039;);&lt;br /&gt;$text = $tpl-&amp;gt;xpath(&amp;#039;//w:t&amp;#039;);&lt;br /&gt;foreach ($text as $t) {&lt;br /&gt;&amp;nbsp; echo &amp;quot;&amp;lt;h2&amp;gt;&amp;quot; . $t . &amp;quot;&amp;lt;/h2&amp;gt;&amp;quot;;&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
but I need to perform a search for the parent xml tag containing the w:name of the provision that requires processing, then update the value of its child w:t node, in this test case w:name=&quot;a119421&quot;&lt;/p&gt;
&lt;p&gt;Here again is the xml tag with the w:name=&quot;a119421&quot; info - I do not know how to work with an xml tag with multiple values such as this...&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;aml:annotation aml:id=&amp;quot;2&amp;quot; w:type=&amp;quot;Word.Bookmark.Start&amp;quot; w:name=&amp;quot;a119421&amp;quot;/&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Here is the text I want to change:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;w:t&amp;gt;VPAT text supplemented with testing results, including all core &lt;br /&gt;functionality, with exceptions specifically noted.&amp;lt;/w:t&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
Now here is the entire cell, opening and closing tags, of the text I want to change: &lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;aml:annotation aml:id=&amp;quot;2&amp;quot; w:type=&amp;quot;Word.Bookmark.Start&amp;quot; w:name=&amp;quot;a119421&amp;quot;/&amp;gt;&amp;lt;w:tc&amp;gt;&amp;lt;w:tcPr&amp;gt;&amp;lt;w:tcW w:w=&amp;quot;4680&amp;quot; w:type=&amp;quot;dxa&amp;quot;/&amp;gt;&amp;lt;/w:tcPr&amp;gt;&amp;lt;w:p wsp:rsidR=&amp;quot;000810DA&amp;quot; wsp:rsidRPr=&amp;quot;0030483F&amp;quot; wsp:rsidRDefault=&amp;quot;00991DED&amp;quot; wsp:rsidP=&amp;quot;000810DA&amp;quot;&amp;gt;&amp;lt;w:pPr&amp;gt;&amp;lt;w:tabs&amp;gt;&amp;lt;w:tab w:val=&amp;quot;left&amp;quot; w:pos=&amp;quot;4944&amp;quot;/&amp;gt;&amp;lt;w:tab w:val=&amp;quot;left&amp;quot; w:pos=&amp;quot;7519&amp;quot;/&amp;gt;&amp;lt;/w:tabs&amp;gt;&amp;lt;/w:pPr&amp;gt;&amp;lt;w:r&amp;gt;&amp;lt;w:t&amp;gt;VPAT text supplemented with testing results, including all core functionality, with exceptions specifically noted.&amp;lt;/w:t&amp;gt;&amp;lt;/w:r&amp;gt;&amp;lt;aml:annotation aml:id=&amp;quot;2&amp;quot; w:type=&amp;quot;Word.Bookmark.End&amp;quot;/&amp;gt;&amp;lt;/w:p&amp;gt;&amp;lt;/w:tc&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
notice, the aml (annotation markup language) opener tag is before the w:tc table cell opener tag; but the aml end tag is also before the /w:tc tag - perhaps this doesn&#039;t matter&lt;/p&gt;
&lt;p&gt;this is code created in MS Word 2003 saving a /word doc as XML...&lt;/p&gt;
 </description>
     <pubDate>Sat, 30 Aug 2008 18:23:36 +0000</pubDate>
 <dc:creator>decibel.places</dc:creator>
 <guid isPermaLink="false">comment 1232871 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
