{"id":11793,"date":"2019-06-20T08:00:49","date_gmt":"2019-06-19T23:00:49","guid":{"rendered":"https:\/\/www.ka-net.org\/blog\/?p=11793"},"modified":"2019-06-20T09:55:34","modified_gmt":"2019-06-20T00:55:34","slug":"%e5%90%8d%e5%89%8d%e7%a9%ba%e9%96%93%e3%82%92%e6%8c%87%e5%ae%9a%e3%81%97%e3%81%a6xpath%e3%81%a7%e8%a6%81%e7%b4%a0%e3%82%92%e5%8f%96%e5%be%97%e3%81%99%e3%82%8bvba%e3%83%9e%e3%82%af%e3%83%ad","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=11793","title":{"rendered":"\u540d\u524d\u7a7a\u9593\u3092\u6307\u5b9a\u3057\u3066XPath\u3067\u8981\u7d20\u3092\u53d6\u5f97\u3059\u308bVBA\u30de\u30af\u30ed"},"content":{"rendered":"<p><a href=\"https:\/\/techcommunity.microsoft.com\/\" title=\"Home - Microsoft Tech Community\" target=\"_blank\" rel=\"noopener noreferrer\">Tech Community<\/a>\u306b\u3001<i>\u201cXPath\u3067\u540d\u524d\u7a7a\u9593\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u4ed8\u306e\u8981\u7d20\u3092\u53d6\u5f97\u3057\u305f\u3044\u201d<\/i>\u3001\u3068\u3044\u3046<a href=\"https:\/\/techcommunity.microsoft.com\/t5\/Excel\/XPath-and-name-space\/m-p\/680697\" title=\"XPath and name space - Microsoft Tech Community - 680697\" target=\"_blank\" rel=\"noopener noreferrer\">\u8cea\u554f<\/a>\u304c\u3042\u308a\u307e\u3057\u305f\u3002<br \/>\n\u3053\u308c\u306fXML\u3092\u6271\u3046\u3068\u304d\u306b\u5272\u3068\u3088\u304f\u30cf\u30de\u308b\u30dd\u30a4\u30f3\u30c8\u3067\u3001Microsoft\u306e\u30b5\u30dd\u30fc\u30c8\u30da\u30fc\u30b8\u306b\u3082\u5bfe\u5fdc\u7b56\u304c\u8a18\u8f09\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<div class=\"linkcard\"><div class=\"lkc-external-wrap\"><a class=\"lkc-link no_icon\" href=\"https:\/\/support.microsoft.com\/ja-jp\/help\/288147\/how-to-use-xpath-to-query-against-a-user-defined-default-namespace\" target=\"_blank\" rel=\"external nofollow noopener\"><div class=\"lkc-card\"><div class=\"lkc-info\"><div class=\"lkc-favicon\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.google.com\/s2\/favicons?domain=support.microsoft.com\" alt=\"\" width=\"16\" height=\"16\" \/><\/div><div class=\"lkc-domain\">support.microsoft.com<\/div><\/div><div class=\"lkc-content\"><figure class=\"lkc-thumbnail\"><img decoding=\"async\" class=\"lkc-thumbnail-img\" src=\"https:\/\/s.wordpress.com\/mshots\/v1\/https%3A%2F%2Fsupport.microsoft.com%2Fja-jp%2Fhelp%2F288147%2Fhow-to-use-xpath-to-query-against-a-user-defined-default-namespace?w=100\" width=\"100px\" height=\"108px\" alt=\"\" \/><\/figure><div class=\"lkc-title\">XPath \u3092\u4f7f\u7528\u3057\u3066\u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u306e\u65e2\u5b9a\u306e\u540d\u524d\u7a7a\u9593\u306b\u5bfe\u3057\u3066\u30af\u30a8\u30ea\u3059\u308b\u65b9\u6cd5<\/div><div class=\"lkc-url\" title=\"https:\/\/support.microsoft.com\/ja-jp\/help\/288147\/how-to-use-xpath-to-query-against-a-user-defined-default-namespace\">https:\/\/support.microsoft.com\/ja-jp\/help\/288147\/how-to-use-xpath-to-query-against-a-user-defined-default-namespace<\/div><div class=\"lkc-excerpt\">XPath \u3092\u4f7f\u7528\u3057\u3066\u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u306e\u65e2\u5b9a\u306e\u540d\u524d\u7a7a\u9593\u306b\u5bfe\u3057\u3066\u30af\u30a8\u30ea\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002\u73fe\u8c61\u3092\u518d\u73fe\u3059\u308b\u305f\u3081\u306e\u30b3\u30fc\u30c9\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002<\/div><\/div><div class=\"clear\"><\/div><\/div><\/a><\/div><\/div>\n<div class=\"linkcard\"><div class=\"lkc-external-wrap\"><a class=\"lkc-link no_icon\" href=\"https:\/\/support.microsoft.com\/ja-jp\/help\/294797\/how-to-specify-namespace-when-querying-the-dom-with-xpath\" target=\"_blank\" rel=\"external nofollow noopener\"><div class=\"lkc-card\"><div class=\"lkc-info\"><div class=\"lkc-favicon\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.google.com\/s2\/favicons?domain=support.microsoft.com\" alt=\"\" width=\"16\" height=\"16\" \/><\/div><div class=\"lkc-domain\">support.microsoft.com<\/div><\/div><div class=\"lkc-content\"><figure class=\"lkc-thumbnail\"><img decoding=\"async\" class=\"lkc-thumbnail-img\" src=\"https:\/\/s.wordpress.com\/mshots\/v1\/https%3A%2F%2Fsupport.microsoft.com%2Fja-jp%2Fhelp%2F294797%2Fhow-to-specify-namespace-when-querying-the-dom-with-xpath?w=100\" width=\"100px\" height=\"108px\" alt=\"\" \/><\/figure><div class=\"lkc-title\">DOM \u3067 XPath \u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3059\u308b\u5834\u5408\u306f\u3092\u540d\u524d\u7a7a\u9593\u3092\u6307\u5b9a\u3059\u308b\u306b\u306f\u3001\u65b9\u6cd5<\/div><div class=\"lkc-url\" title=\"https:\/\/support.microsoft.com\/ja-jp\/help\/294797\/how-to-specify-namespace-when-querying-the-dom-with-xpath\">https:\/\/support.microsoft.com\/ja-jp\/help\/294797\/how-to-specify-namespace-when-querying-the-dom-with-xpath<\/div><\/div><div class=\"clear\"><\/div><\/div><\/a><\/div><\/div>\n<p>\u8981\u3059\u308b\u306b\u3001<a href=\"https:\/\/docs.microsoft.com\/ja-jp\/previous-versions\/windows\/desktop\/ms760290(v=vs.85)\" title=\"setProperty Method1 | Microsoft Docs\" target=\"_blank\" rel=\"noopener noreferrer\">setProperty<\/a>\u30e1\u30bd\u30c3\u30c9\u3067\u3001<a href=\"https:\/\/docs.microsoft.com\/ja-jp\/previous-versions\/windows\/desktop\/ms756048(v=vs.85)\" title=\"SelectionNamespaces Property | Microsoft Docs\" target=\"_blank\" rel=\"noopener noreferrer\">SelectionNamespaces<\/a>\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u5024\u3068\u3057\u3066\u540d\u524d\u7a7a\u9593\u3092\u6307\u5b9a\u3057\u3066\u3042\u3052\u308c\u3070\u826f\u3044\u308f\u3051\u3067\u3059\u306d\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Public Sub Sample()\r\n  Dim src As String\r\n  Dim lst As Object\r\n  \r\n  src = &quot;&lt;?xml version ='1.0' encoding='utf-8'?&gt;&quot; &amp; vbNewLine &amp; _\r\n        &quot;&lt;a:Books xmlns:a='x-schema:bookschema.xml'&gt;&quot; &amp; vbNewLine &amp; _\r\n        &quot;  &lt;a:Book&gt;&quot; &amp; vbNewLine &amp; _\r\n        &quot;    &lt;title&gt;Presenting XML&lt;\/title&gt;&quot; &amp; vbNewLine &amp; _\r\n        &quot;    &lt;author&gt;Richard Light&lt;\/author&gt;&quot; &amp; vbNewLine &amp; _\r\n        &quot;  &lt;\/a:Book&gt;&quot; &amp; vbNewLine &amp; _\r\n        &quot;  &lt;a:Book&gt;&quot; &amp; vbNewLine &amp; _\r\n        &quot;    &lt;title&gt;Mastering VBA for Microsoft Office 2016&lt;\/title&gt;&quot; &amp; vbNewLine &amp; _\r\n        &quot;    &lt;author&gt;Richard Mansfield&lt;\/author&gt;&quot; &amp; vbNewLine &amp; _\r\n        &quot;  &lt;\/a:Book&gt;&quot; &amp; vbNewLine &amp; _\r\n        &quot;&lt;\/a:Books&gt;&quot;\r\n  \r\n  With CreateObject(&quot;MSXML2.DOMDocument.6.0&quot;)\r\n    .async = False\r\n    If .LoadXML(src) = True Then\r\n      .SetProperty &quot;SelectionLanguage&quot;, &quot;XPath&quot;\r\n      .SetProperty &quot;SelectionNamespaces&quot;, &quot;xmlns:a='x-schema:bookschema.xml'&quot; '\u540d\u524d\u7a7a\u9593\u306e\u6307\u5b9a\r\n      Set lst = .SelectNodes(&quot;\/\/a:Book&quot;)\r\n      Debug.Print lst.Item(0).XML\r\n      Stop\r\n    End If\r\n  End With\r\nEnd Sub<\/pre>\n<p>\u4e0a\u8a18\u30b3\u30fc\u30c9\u306f\u7c21\u5358\u306a\u30b5\u30f3\u30d7\u30eb\u3067\u3059\u304c\u3001\u30b3\u30fc\u30c9\u4e2d\u306e\u4e0b\u8a18\u884c\u3092\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3059\u308b\u3068\u30aa\u30fc\u30c8\u30e1\u30fc\u30b7\u30e7\u30f3\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u306e\u304c\u5206\u304b\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">.SetProperty &quot;SelectionNamespaces&quot;, &quot;xmlns:a='x-schema:bookschema.xml'&quot;<\/pre>\n<div id=\"single_banner_area2\" class=\"clearfix one_banner\">\n<div class=\"single_banner single_banner_left\">\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<!-- \u8a18\u4e8b\u4e2d(\u30c7\u30a3\u30b9\u30d7\u30ec\u30a4\u5e83\u544a\u30e6\u30cb\u30c3\u30c8) -->\r\n<ins class=\"adsbygoogle\"\r\n     style=\"display:block\"\r\n     data-ad-client=\"ca-pub-7306936664602087\"\r\n     data-ad-slot=\"5429724765\"\r\n     data-ad-format=\"auto\"\r\n     data-full-width-responsive=\"true\"><\/ins>\r\n<script>\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n<\/script>\n<\/div>\n<div class=\"single_banner single_banner_right\">\n<a href=\"\" target=\"_blank\"><img decoding=\"async\" src=\"\" alt=\"\" title=\"\" \/><\/a>\n<\/div>\n<\/div>\n\n","protected":false},"excerpt":{"rendered":"Tech Community\u306b\u3001\u201cXPath\u3067\u540d\u524d\u7a7a\u9593\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u4ed8\u306e\u8981\u7d20\u3092\u53d6\u5f97\u3057\u305f\u3044\u201d\u3001\u3068\u3044\u3046\u8cea\u554f\u304c\u3042\u308a\u307e\u3057\u305f\u3002 \u3053\u308c\u306fXML\u3092\u6271\u3046\u3068\u304d\u306b\u5272\u3068\u3088\u304f\u30cf\u30de\u308b\u30dd\u30a4\u30f3\u30c8\u3067\u3001Microsoft\u306e\u30b5\u30dd\u30fc\u30c8\u30da\u30fc\u30b8\u306b\u3082\u5bfe\u5fdc\u7b56\u304c\u8a18\u8f09\u3055 [&hellip;]","protected":false},"author":1,"featured_media":7120,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"[\u540d\u524d\u7a7a\u9593\u3092\u6307\u5b9a\u3057\u3066XPath\u3067\u8981\u7d20\u3092\u53d6\u5f97\u3059\u308bVBA\u30de\u30af\u30ed]","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,48,49,58],"tags":[],"class_list":["post-11793","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-excel-office","category-word-office","category-powerpoint"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-OfficeVBA.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-34d","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/11793","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11793"}],"version-history":[{"count":3,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/11793\/revisions"}],"predecessor-version":[{"id":11796,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/11793\/revisions\/11796"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7120"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11793"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}