| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| |
| --> |
| <apiPackage xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" id="flash.xml" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiPackage/apiPackage "><apiName class="- topic/title reference/title apiRef/apiName ">flash.xml</apiName><apiDetail class="- topic/body reference/refbody apiRef/apiDetail "/><apiClassifier languages="" id="flash.xml:XMLNode" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">XMLNode</apiName><shortdesc class="- topic/shortdesc "> |
| XMLNode クラスは、ActionScript 2.0 に存在していて、ActionScript 3.0 で名前が変更された、古い XML オブジェクトを表します。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">XMLNode, XMLNode object, built-in class |
| </keyword></asCustoms></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| XMLNode クラスは、ActionScript 2.0 にあり、ActionScript 3.0 で名前が変更された、古い XML オブジェクトを表します。ActionScript 3.0 では、代わりに E4X(ECMAScript for XML)をサポートする新しいトップレベルの <xref href="../../XML.html" class="- topic/xref ">XML</xref> クラスおよび関連クラスを使用することをお勧めします。XMLNode クラスがあるのは、後方互換性を維持するためです。 |
| |
| </apiDesc><example conref="examples\XMLDocumentExample.as" class="- topic/example "> 次の例では、XMLDocument クラスおよび XMLNode クラスを使用し、XML ドキュメントを解析してフォーマットします。この例では、外部 XML ファイルをロードするのではなく、トップレベルの XML クラスを使用して、XML ドキュメントを作成し、これを解析します。 |
| <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock "> |
| package { |
| import flash.display.Sprite; |
| import flash.xml.XMLDocument; |
| import flash.xml.XMLNode; |
| import flash.xml.XMLNodeType; |
| |
| public class XMLDocumentExample extends Sprite { |
| public function XMLDocumentExample() { |
| var result:XMLDocument = new XMLDocument(); |
| result.ignoreWhite = true; |
| result.parseXML(getXMLString()); |
| |
| var books:Array = parseBooks(result.firstChild); |
| trace("books: \n" + books); |
| } |
| |
| private function parseBooks(node:XMLNode):Array { |
| var books:Array = new Array(); |
| |
| var kids:Array = node.childNodes; |
| for each(var item:XMLNode in kids) { |
| parseBook(item, books); |
| } |
| |
| return books; |
| } |
| |
| private function parseBook(node:XMLNode, books:Array):void { |
| var item:Book = new Book(); |
| item.setPublisher(node.attributes.publisher); |
| item.setName(node.attributes.name); |
| books.push(item); |
| } |
| |
| private function getXMLString():String { |
| var list:XML = <books> |
| <book publisher="Addison-Wesley" name="Design Patterns" /> |
| <book publisher="Addison-Wesley" name="The Pragmatic Programmer" /> |
| <book publisher="Addison-Wesley" name="Test Driven Development" /> |
| <book publisher="Addison-Wesley" name="Refactoring to Patterns" /> |
| <book publisher="O'Reilly Media" name="The Cathedral & the Bazaar" /> |
| <book publisher="O'Reilly Media" name="Unit Test Frameworks" /> |
| </books>; |
| return list.toXMLString(); |
| } |
| } |
| |
| } |
| class Book { |
| private var publisher:String; |
| private var name:String; |
| |
| public function setPublisher(publisher:String):void { |
| this.publisher = publisher; |
| } |
| |
| public function setName(name:String):void { |
| this.name = name; |
| } |
| |
| public function toString():String { |
| return "[Book name: " + name + " publisher: " + publisher + "]\n"; |
| } |
| } |
| </codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="#XML" class="- topic/link "><linktext class="- topic/linktext ">XML</linktext></link><link href="flash.xml.xml#XMLDocument" class="- topic/link "><linktext class="- topic/linktext ">flash.xml.XMLDocument</linktext></link></related-links><apiConstructor id="flash.xml:XMLNode:XMLNode" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">XMLNode</apiName><shortdesc class="- topic/shortdesc "> |
| 新しい XMLNode オブジェクトを作成します。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">new XMLNode, new, constructor |
| </keyword></asCustoms></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">type</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">uint</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">ノードタイプは、XML エレメントの場合は 1、テキストノードの場合は 3 になります。 |
| </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">value</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">新しい XMLNode オブジェクトを作成するために解析される XML テキストです。 |
| |
| |
| |
| |
| |
| </apiDesc></apiParam></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| 新しい XMLNode オブジェクトを作成します。XMLNode クラスのメソッドを呼び出す前に、コンストラクターを使用して XMLNode オブジェクトを作成する必要があります。 |
| <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意:XML ドキュメントツリーにエレメントとテキストノードを追加するには、</b><codeph class="+ topic/ph pr-d/codeph ">createElement()</codeph> メソッドおよび <codeph class="+ topic/ph pr-d/codeph ">createTextNode()</codeph> メソッドを使用します。</p> |
| |
| </apiDesc></apiConstructorDetail><related-links class="- topic/related-links "><link href="flash.xml.xml#XMLDocument/createElement()" class="- topic/link "><linktext class="- topic/linktext ">XMLDocument.createElement()</linktext></link><link href="flash.xml.xml#XMLDocument/createTextNode()" class="- topic/link "><linktext class="- topic/linktext ">XMLDocument.createTextNode()</linktext></link></related-links></apiConstructor><apiOperation id="flash.xml:XMLNode:appendChild" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">appendChild</apiName><shortdesc class="- topic/shortdesc "> |
| |
| 指定されたノードを XML オブジェクトの子リストに追加します。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">XMLNode.appendchild, appendchild |
| </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">node</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.xml:XMLNode</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">現在の場所から <codeph class="+ topic/ph pr-d/codeph ">my_xml</codeph> オブジェクトの子リストに移動されるノードを表す XMLNode です。 |
| |
| |
| |
| </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| |
| 指定されたノードを XML オブジェクトの子リストに追加します。このメソッドは、パラメーター <codeph class="+ topic/ph pr-d/codeph ">childNode</codeph> で参照されるノードに対して直接実行されます。ノードのコピーが追加されるわけではありません。追加するノードが別のツリー構造内に既に存在している場合は、ノードを新しい場所に追加すると現在の場所からノードが削除されます。パラメーター <codeph class="+ topic/ph pr-d/codeph ">childNode</codeph> が、別の XML ツリー構造内に既に存在しているノードを参照している場合、追加される子ノードは、今までの親ノードから削除された後で新しいツリー構造に置かれます。 |
| |
| </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.xml:XMLNode:cloneNode" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">cloneNode</apiName><shortdesc class="- topic/shortdesc "> |
| |
| 指定された XML オブジェクトと同じタイプ、名前、値、および属性を持つ新しい XML ノードを作成し、返します。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">XMLNode.clonenode, clodenode |
| </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">XMLNode オブジェクトです。 |
| |
| |
| |
| </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.xml:XMLNode</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">deep</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">ブール値です。<codeph class="+ topic/ph pr-d/codeph ">true</codeph> に設定した場合、指定された XML オブジェクトの子のクローンが再帰的に作成されます。 |
| |
| </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| |
| 指定された XML オブジェクトと同じタイプ、名前、値、および属性を持つ新しい XML ノードを作成し、返します。<codeph class="+ topic/ph pr-d/codeph ">deep</codeph> に <codeph class="+ topic/ph pr-d/codeph ">true</codeph> を設定すると、すべての子ノードのクローンが再帰的に作成されるため、元のオブジェクトのドキュメントツリーが正確に複製されます。 |
| <p class="- topic/p ">返されるノードのクローンは、クローン作成元のアイテムのツリーとは関連がなくなります。その結果、<codeph class="+ topic/ph pr-d/codeph ">nextSibling</codeph>、<codeph class="+ topic/ph pr-d/codeph ">parentNode</codeph>、および <codeph class="+ topic/ph pr-d/codeph ">previousSibling</codeph> の値はすべて <codeph class="+ topic/ph pr-d/codeph ">null</codeph> になります。<codeph class="+ topic/ph pr-d/codeph ">deep</codeph> パラメーターが <codeph class="+ topic/ph pr-d/codeph ">false</codeph> の場合、または <codeph class="+ topic/ph pr-d/codeph ">my_xml</codeph> ノードに子ノードがない場合は、<codeph class="+ topic/ph pr-d/codeph ">firstChild</codeph> と <codeph class="+ topic/ph pr-d/codeph ">lastChild</codeph> も null です。</p> |
| |
| </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.xml:XMLNode:getNamespaceForPrefix" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">getNamespaceForPrefix</apiName><shortdesc class="- topic/shortdesc "> |
| ノードに指定された接頭辞に関連付けられている名前空間 URI を返します。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><refpath> |
| </refpath></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">指定された接頭辞に関連付けられている名前空間です。 |
| |
| </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">prefix</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">このメソッドが返す名前空間に関連付けられている接頭辞です。 |
| |
| </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| ノードに指定された接頭辞に関連付けられている名前空間 URI を返します。URI を特定するために、<codeph class="+ topic/ph pr-d/codeph ">getPrefixForNamespace()</codeph> は XML 階層をノードから上方向に検索し、最初の <codeph class="+ topic/ph pr-d/codeph ">xmlns</codeph> 宣言の名前空間 URI を必要に応じて返します。この名前空間 URI は、指定された <codeph class="+ topic/ph pr-d/codeph ">prefix</codeph> に関連付けられているものです。 |
| |
| <p class="- topic/p ">指定された接頭辞に対して定義されている名前空間がない場合は、<codeph class="+ topic/ph pr-d/codeph ">null</codeph> 値が返されます。</p> |
| |
| <p class="- topic/p ">空のストリング(<codeph class="+ topic/ph pr-d/codeph ">""</codeph>)を <codeph class="+ topic/ph pr-d/codeph ">prefix</codeph> として指定する場合、ノードに対して定義されているデフォルトの名前空間(例えば <codeph class="+ topic/ph pr-d/codeph ">xmlns="http://www.example.com/"</codeph>)があると、このメソッドはデフォルトの名前空間 URI を返します。 |
| </p> |
| |
| </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.xml.xml#XMLNode/getPrefixForNamespace()" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.getPrefixForNamespace()</linktext></link><link href="flash.xml.xml#XMLNode/namespaceURI" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.namespaceURI</linktext></link></related-links></apiOperation><apiOperation id="flash.xml:XMLNode:getPrefixForNamespace" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">getPrefixForNamespace</apiName><shortdesc class="- topic/shortdesc "> |
| ノードに指定された名前空間 URI に関連付けられている接頭辞を返します。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword "> |
| </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">指定された名前空間に関連付けられている接頭辞です。 |
| |
| </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ns</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">このメソッドが返す接頭辞に関連付けられている名前空間 URI です。 |
| |
| </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| ノードに指定された名前空間 URI に関連付けられている接頭辞を返します。接頭辞を特定するために、<codeph class="+ topic/ph pr-d/codeph ">getPrefixForNamespace()</codeph> は XML 階層をノードから上方向に検索し、最初の <codeph class="+ topic/ph pr-d/codeph ">xmlns</codeph> 宣言の接頭辞を必要に応じて返します。この接頭辞は、<codeph class="+ topic/ph pr-d/codeph ">ns</codeph> に一致する名前空間 URI に関連付けられているものです。 |
| |
| <p class="- topic/p ">その URI に対応する <codeph class="+ topic/ph pr-d/codeph ">xmlns</codeph> 宣言がない場合、<codeph class="+ topic/ph pr-d/codeph ">null</codeph> が返されます。その URI に対応する <codeph class="+ topic/ph pr-d/codeph ">xmlns</codeph> 宣言があり、その宣言に関連付けられている接頭辞がない場合は、空のストリング(<codeph class="+ topic/ph pr-d/codeph ">""</codeph>)が返されます。 |
| </p> |
| |
| </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.xml.xml#XMLNode/getNamespaceForPrefix()" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.getNamespaceForPrefix()</linktext></link><link href="flash.xml.xml#XMLNode/namespaceURI" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.namespaceURI</linktext></link></related-links></apiOperation><apiOperation id="flash.xml:XMLNode:hasChildNodes" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">hasChildNodes</apiName><shortdesc class="- topic/shortdesc "> |
| 指定された XMLNode オブジェクトに子ノードがあるかどうかを示します。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">XMLNode.haschildnodes, haschildnodes, has child nodes |
| </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">指定された XMLNode オブジェクトに子ノードがある場合は <codeph class="+ topic/ph pr-d/codeph ">true</codeph> を、それ以外の場合は <codeph class="+ topic/ph pr-d/codeph ">false</codeph> を返します。 |
| |
| </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| 指定された XMLNode オブジェクトに子ノードがあるかどうかを示します。このプロパティは、指定された XMLNode オブジェクトに子ノードがある場合は <codeph class="+ topic/ph pr-d/codeph ">true</codeph> で、それ以外の場合は <codeph class="+ topic/ph pr-d/codeph ">false</codeph> です。 |
| |
| </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.xml:XMLNode:insertBefore" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">insertBefore</apiName><shortdesc class="- topic/shortdesc "> |
| XML オブジェクトの子リスト内の beforeNode ノードの前に新しい子ノードを挿入します。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">XMLNode.insertbefore, insertbefore, insert before |
| </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">node</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.xml:XMLNode</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">挿入される XMLNode オブジェクトです。 |
| </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">before</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.xml:XMLNode</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc "><codeph class="+ topic/ph pr-d/codeph ">childNode</codeph> の挿入位置の直前の XMLNode オブジェクトです。 |
| |
| </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| XML オブジェクトの子リスト内の <codeph class="+ topic/ph pr-d/codeph ">beforeNode</codeph> ノードの前に新しい子ノードを挿入します。<codeph class="+ topic/ph pr-d/codeph ">beforeNode</codeph> パラメーターが undefined または null の場合、ノードは <codeph class="+ topic/ph pr-d/codeph ">appendChild()</codeph> メソッドを使用して追加されます。<codeph class="+ topic/ph pr-d/codeph ">beforeNode</codeph> が <codeph class="+ topic/ph pr-d/codeph ">my_xml</codeph> の子でない場合、挿入は失敗します。 |
| |
| </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.xml.xml#XMLNode/cloneNode()" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.cloneNode()</linktext></link></related-links></apiOperation><apiOperation id="flash.xml:XMLNode:removeNode" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">removeNode</apiName><shortdesc class="- topic/shortdesc "> |
| 指定された XML オブジェクトをその親から削除します。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">XMLNode.removenode, removenode, remove node |
| </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| 指定された XML オブジェクトをその親から削除します。また、ノードのすべての子孫も削除します。 |
| |
| |
| |
| </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.xml:XMLNode:toString" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">toString</apiName><shortdesc class="- topic/shortdesc "> |
| 指定された XMLNode オブジェクトを評価し、ノード、子、および属性を含む XML 構造体のテキスト表現を作成し、結果をストリングとして返します。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">XMLNode.tostring, tostring |
| </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">XMLNode オブジェクトを表すストリングです。 |
| |
| |
| </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| 指定された XMLNode オブジェクトを評価し、ノード、子、および属性を含む XML 構造体のテキスト表現を作成し、結果をストリングとして返します。 |
| |
| <p class="- topic/p ">トップレベルの XMLDocument オブジェクト(コンストラクターで作成されたオブジェクト)の場合は、<codeph class="+ topic/ph pr-d/codeph ">XMLDocument.toString()</codeph> メソッドがドキュメントの XML 宣言(保存場所は <codeph class="+ topic/ph pr-d/codeph ">XMLDocument.xmlDecl</codeph> プロパティ)を出力し、その後にドキュメントの <codeph class="+ topic/ph pr-d/codeph ">DOCTYPE</codeph> 宣言(保存場所は <codeph class="+ topic/ph pr-d/codeph ">XMLDocument.docTypeDecl</codeph> プロパティ)、さらにオブジェクト内のすべての XML ノードのテキスト表現と続きます。XML 宣言は、<codeph class="+ topic/ph pr-d/codeph ">XMLDocument.xmlDecl</codeph> プロパティが <codeph class="+ topic/ph pr-d/codeph ">null</codeph> の場合は出力されません。<codeph class="+ topic/ph pr-d/codeph ">DOCTYPE</codeph> 宣言は、<codeph class="+ topic/ph pr-d/codeph ">XMLDocument.docTypeDecl</codeph> プロパティが <codeph class="+ topic/ph pr-d/codeph ">null</codeph> の場合は出力されません。</p> |
| |
| </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.xml.xml#XMLDocument/docTypeDecl" class="- topic/link "><linktext class="- topic/linktext ">XMLDocument.docTypeDecl</linktext></link><link href="flash.xml.xml#XMLDocument/xmlDecl" class="- topic/link "><linktext class="- topic/linktext ">XMLDocument.xmlDecl</linktext></link></related-links></apiOperation><apiValue id="flash.xml:XMLNode:firstChild" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">firstChild</apiName><shortdesc class="- topic/shortdesc "> |
| 指定された XMLDocument オブジェクトを評価し、親ノードの子リスト内の最初の子を参照します。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">XMLNode.firstchild, first child |
| </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.xml:XMLNode</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| 指定された XMLDocument オブジェクトを評価し、親ノードの子リスト内の最初の子を参照します。このプロパティは、ノードに子がないときは <codeph class="+ topic/ph pr-d/codeph ">null</codeph> です。ノードがテキストノードの場合、このプロパティは <codeph class="+ topic/ph pr-d/codeph ">undefined</codeph> です。これは読み取り専用プロパティなので、子ノードの操作には使用できません。子ノードを操作するには、<codeph class="+ topic/ph pr-d/codeph ">appendChild()</codeph> メソッド、<codeph class="+ topic/ph pr-d/codeph ">insertBefore()</codeph> メソッド、および <codeph class="+ topic/ph pr-d/codeph ">removeNode()</codeph> メソッドを使用します。 |
| |
| |
| </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.xml.xml#XMLNode/appendChild()" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.appendChild()</linktext></link><link href="flash.xml.xml#XMLNode/insertBefore()" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.insertBefore()</linktext></link><link href="flash.xml.xml#XMLNode/removeNode()" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.removeNode()</linktext></link></related-links></apiValue><apiValue id="flash.xml:XMLNode:lastChild" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">lastChild</apiName><shortdesc class="- topic/shortdesc "> |
| ノードの子リスト内の最後の子を参照する XMLNode 値です。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">XMLNode.lastchild, lastchild, last child |
| </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.xml:XMLNode</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| ノードの子リスト内の最後の子を参照する XMLNode 値です。<codeph class="+ topic/ph pr-d/codeph ">XMLNode.lastChild</codeph> プロパティは、ノードに子がないときは <codeph class="+ topic/ph pr-d/codeph ">null</codeph> です。このプロパティは子ノードの操作には使用できません。子ノードを操作するには、<codeph class="+ topic/ph pr-d/codeph ">appendChild()</codeph> メソッド、<codeph class="+ topic/ph pr-d/codeph ">insertBefore()</codeph> メソッド、および <codeph class="+ topic/ph pr-d/codeph ">removeNode()</codeph> メソッドを使用します。 |
| |
| |
| </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.xml.xml#XMLNode/appendChild()" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.appendChild()</linktext></link><link href="flash.xml.xml#XMLNode/insertBefore()" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.insertBefore()</linktext></link><link href="flash.xml.xml#XMLNode/removeNode()" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.removeNode()</linktext></link></related-links></apiValue><apiValue id="flash.xml:XMLNode:nextSibling" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">nextSibling</apiName><shortdesc class="- topic/shortdesc "> |
| 親ノードの子リスト内の次の子ノードを参照する XMLNode 値です。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">XMLNode.nextsibling, next sibling |
| </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.xml:XMLNode</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| 親ノードの子リスト内の次の子ノードを参照する XMLNode 値です。子リストに次のノードがない場合、このプロパティは <codeph class="+ topic/ph pr-d/codeph ">null</codeph> になります。このプロパティは子ノードの操作には使用できません。子ノードを操作するには、<codeph class="+ topic/ph pr-d/codeph ">appendChild()</codeph> メソッド、<codeph class="+ topic/ph pr-d/codeph ">insertBefore()</codeph> メソッド、および <codeph class="+ topic/ph pr-d/codeph ">removeNode()</codeph> メソッドを使用します。 |
| |
| |
| </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.xml.xml#XMLNode/firstChild" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.firstChild</linktext></link><link href="flash.xml.xml#XMLNode/appendChild()" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.appendChild()</linktext></link><link href="flash.xml.xml#XMLNode/insertBefore()" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.insertBefore()</linktext></link><link href="flash.xml.xml#XMLNode/removeNode()" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.removeNode()</linktext></link></related-links></apiValue><apiValue id="flash.xml:XMLNode:nodeName" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">nodeName</apiName><shortdesc class="- topic/shortdesc "> |
| XMLNode オブジェクトのノード名を表すストリングです。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">XMLNode.nodename, node name |
| </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| XMLNode オブジェクトのノード名を表すストリングです。XMLNode オブジェクトが XML エレメントである場合(<codeph class="+ topic/ph pr-d/codeph ">nodeType == 1</codeph>)、<codeph class="+ topic/ph pr-d/codeph ">nodeName</codeph> は XML ファイル内のノードを表すタグの名前です。例えば、<codeph class="+ topic/ph pr-d/codeph ">TITLE</codeph> は <codeph class="+ topic/ph pr-d/codeph ">nodeName</codeph>(HTML <codeph class="+ topic/ph pr-d/codeph ">TITLE</codeph> タグ)です。XMLNode オブジェクトがテキストノードである(<codeph class="+ topic/ph pr-d/codeph ">nodeType == 3</codeph>)場合、nodeName は <codeph class="+ topic/ph pr-d/codeph ">null</codeph> です。 |
| |
| |
| </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.xml.xml#XMLNode/nodeType" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.nodeType</linktext></link></related-links></apiValue><apiValue id="flash.xml:XMLNode:nodeType" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">nodeType</apiName><shortdesc class="- topic/shortdesc "> |
| nodeType 定数値です。XML エレメントの場合は XMLNodeType.ELEMENT_NODE、テキストノードの場合は XMLNodeType.TEXT_NODE になります。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">XML.nodetype, node type |
| </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| <codeph class="+ topic/ph pr-d/codeph ">nodeType</codeph> の定数値。XML エレメントの場合は <codeph class="+ topic/ph pr-d/codeph ">XMLNodeType.ELEMENT_NODE</codeph>、テキストノードの場合は <codeph class="+ topic/ph pr-d/codeph ">XMLNodeType.TEXT_NODE</codeph> になります。 |
| <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">nodeType</codeph> は、W3C DOM レベル 1 勧告(<xref href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html" scope="external" class="- topic/xref ">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html</xref>)の NodeType の一覧に記載されている数値です。次の表は、これらの数値の一覧です。</p> |
| <p class="- topic/p "><adobetable class="+ topic/table adobe-d/adobetable "><row class="- topic/row "><entry class="- topic/entry ">4</entry><entry class="- topic/entry ">CDATA_SECTION_NODE</entry></row><tgroup cols="2" class="- topic/tgroup "><thead class="- topic/thead "><row class="- topic/row "><entry align="left" class="- topic/entry ">整数値</entry><entry align="left" class="- topic/entry ">定義されている定数</entry></row></thead><tbody class="- topic/tbody "><row class="- topic/row "><entry class="- topic/entry ">1</entry><entry class="- topic/entry ">ELEMENT_NODE</entry></row><row class="- topic/row "><entry class="- topic/entry ">3</entry><entry class="- topic/entry ">TEXT_NODE</entry></row><row class="- topic/row "><entry class="- topic/entry ">5</entry><entry class="- topic/entry ">ENTITY_REFERENCE_NODE</entry></row><row class="- topic/row "><entry class="- topic/entry ">7</entry><entry class="- topic/entry ">PROCESSING_INSTRUCTION_NODE</entry></row><row class="- topic/row "><entry class="- topic/entry ">9</entry><entry class="- topic/entry ">DOCUMENT_NODE</entry></row><row class="- topic/row "><entry class="- topic/entry ">11</entry><entry class="- topic/entry ">DOCUMENT_FRAGMENT_NODE</entry></row></tbody></tgroup></adobetable></p> |
| <p class="- topic/p ">Flash Player に組み込まれている XMLNode クラスがサポートするのは、<codeph class="+ topic/ph pr-d/codeph ">XMLNodeType.ELEMENT_NODE</codeph> と <codeph class="+ topic/ph pr-d/codeph ">XMLNodeType.TEXT_NODE</codeph> だけです。</p> |
| |
| </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.xml.xml#XMLNodeType/TEXT_NODE" class="- topic/link "><linktext class="- topic/linktext ">XMLNodeType.TEXT_NODE</linktext></link><link href="flash.xml.xml#XMLNodeType/ELEMENT_NODE" class="- topic/link "><linktext class="- topic/linktext ">XMLNodeType.ELEMENT_NODE</linktext></link></related-links></apiValue><apiValue id="flash.xml:XMLNode:nodeValue" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">nodeValue</apiName><shortdesc class="- topic/shortdesc "> |
| XMLDocument オブジェクトのノード値です。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">XMLNode.nodevalue, nodevalue, node value |
| </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| XMLDocument オブジェクトのノード値です。XMLDocument オブジェクトがテキストノードである場合、<codeph class="+ topic/ph pr-d/codeph ">nodeType</codeph> は 3 であり、<codeph class="+ topic/ph pr-d/codeph ">nodeValue</codeph> はノードのテキストです。XMLDocument オブジェクトが XML エレメントである(<codeph class="+ topic/ph pr-d/codeph ">nodeType</codeph> が 1)場合、<codeph class="+ topic/ph pr-d/codeph ">nodeValue</codeph> は <codeph class="+ topic/ph pr-d/codeph ">null</codeph> で、読み取り専用です。 |
| |
| |
| </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.xml.xml#XMLNode/nodeType" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.nodeType</linktext></link></related-links></apiValue><apiValue id="flash.xml:XMLNode:parentNode" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">parentNode</apiName><shortdesc class="- topic/shortdesc "> |
| 指定された XML オブジェクトの親ノードを参照する XMLNode 値です。ノードに親がない場合は null を返します。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">XMLNode.parentnode, parentnode, parent node |
| </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.xml:XMLNode</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| 指定された XML オブジェクトの親ノードを参照する XMLNode 値。ノードに親がない場合は <codeph class="+ topic/ph pr-d/codeph ">null</codeph> を返します。これは読み取り専用プロパティなので、子ノードの操作には使用できません。子ノードを操作するには、<codeph class="+ topic/ph pr-d/codeph ">appendChild()</codeph> メソッド、<codeph class="+ topic/ph pr-d/codeph ">insertBefore()</codeph> メソッド、および <codeph class="+ topic/ph pr-d/codeph ">removeNode()</codeph> メソッドを使用します。 |
| |
| </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.xml.xml#XMLNode/appendChild()" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.appendChild()</linktext></link><link href="flash.xml.xml#XMLNode/insertBefore()" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.insertBefore()</linktext></link><link href="flash.xml.xml#XMLNode/removeNode()" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.removeNode()</linktext></link></related-links></apiValue><apiValue id="flash.xml:XMLNode:previousSibling" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">previousSibling</apiName><shortdesc class="- topic/shortdesc "> |
| 親ノードの子リスト内の前の子ノードを参照する XMLNode 値です。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">XMLNode.previousSibling, previousSibling |
| </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.xml:XMLNode</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| 親ノードの子リスト内の前の子ノードを参照する XMLNode 値です。ノードに前の子ノードがない場合は、null を返します。このプロパティは子ノードの操作には使用できません。子ノードを操作するには、<codeph class="+ topic/ph pr-d/codeph ">appendChild()</codeph> メソッド、<codeph class="+ topic/ph pr-d/codeph ">insertBefore()</codeph> メソッド、および <codeph class="+ topic/ph pr-d/codeph ">removeNode()</codeph> メソッドを使用します。 |
| |
| |
| </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.xml.xml#XMLNode/lastChild" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.lastChild</linktext></link><link href="flash.xml.xml#XMLNode/appendChild()" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.appendChild()</linktext></link><link href="flash.xml.xml#XMLNode/insertBefore()" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.insertBefore()</linktext></link><link href="flash.xml.xml#XMLNode/removeNode()" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.removeNode()</linktext></link></related-links></apiValue><apiValue id="flash.xml:XMLNode:attributes:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">attributes</apiName><shortdesc class="- topic/shortdesc "> |
| 指定された XMLNode インスタンスのすべての属性を含むオブジェクトです。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">XMLNode.attributes, attributes |
| </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Object</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| 指定された XMLNode インスタンスのすべての属性を含むオブジェクトです。XMLNode 属性オブジェクトには、XMLNode インスタンスの各属性に対して 1 つずつ変数があります。この変数はオブジェクトの一部として定義されているので、通常はオブジェクトのプロパティとして参照されます。各属性の値は、対応するプロパティにストリングとして保存されます。例えば、<codeph class="+ topic/ph pr-d/codeph ">color</codeph> という名前の属性がある場合、次のコードで示すように、<codeph class="+ topic/ph pr-d/codeph ">color</codeph> をプロパティ名として指定して、その属性の値を取得することができます。 |
| <pre xml:space="preserve" class="- topic/pre "> |
| var myColor:String = doc.firstChild.attributes.color |
| </pre> |
| |
| |
| </apiDesc></apiValueDetail></apiValue><apiValue id="flash.xml:XMLNode:childNodes:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">childNodes</apiName><shortdesc class="- topic/shortdesc "> |
| 指定された XMLNode オブジェクトの子の配列です。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">XMLNode.childnodes, childnodes |
| </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Array</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| 指定された XMLNode オブジェクトの子の配列です。配列内の各エレメントは、子ノードを表す XMLNode オブジェクトへの参照です。これは読み取り専用プロパティであり、子ノードの操作には使用できません。 子ノードを操作するには、<codeph class="+ topic/ph pr-d/codeph ">appendChild()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">insertBefore()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">removeNode()</codeph> の各メソッドを使用してください。 |
| |
| <p class="- topic/p ">テキストノード(<codeph class="+ topic/ph pr-d/codeph ">nodeType == 3</codeph>)の場合、このプロパティは undefined になります。</p> |
| |
| |
| </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.xml.xml#XMLNode/nodeType" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.nodeType</linktext></link><link href="flash.xml.xml#XMLNode/appendChild()" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.appendChild()</linktext></link><link href="flash.xml.xml#XMLNode/insertBefore()" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.insertBefore()</linktext></link><link href="flash.xml.xml#XMLNode/removeNode()" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.removeNode()</linktext></link></related-links></apiValue><apiValue id="flash.xml:XMLNode:localName:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">localName</apiName><shortdesc class="- topic/shortdesc "> |
| XML ノード名のローカル名部分です。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword "> |
| </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| XML ノード名のローカル名部分です。名前空間の接頭辞を除いたエレメント名です。例えば、ノード <codeph class="+ topic/ph pr-d/codeph "><contact:mailbox/>bob@example.com</contact:mailbox></codeph> には、ローカル名 "mailbox" と接頭辞 "contact" があり、この 2 つで完全なエレメント名 "contact.mailbox" が構成されます。 |
| |
| <p class="- topic/p ">名前空間の接頭辞には、XML ノードオブジェクトの <codeph class="+ topic/ph pr-d/codeph ">prefix</codeph> プロパティによってアクセスできます。<codeph class="+ topic/ph pr-d/codeph ">nodeName</codeph> プロパティは、接頭辞とローカル名を含む完全な名前を返します。</p> |
| |
| </apiDesc></apiValueDetail></apiValue><apiValue id="flash.xml:XMLNode:namespaceURI:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">namespaceURI</apiName><shortdesc class="- topic/shortdesc "> |
| XML ノードに接頭辞が付いている場合、namespaceURI はその接頭辞(URI)の xmlns 宣言の値となります。これは通常、名前空間 URI と呼ばれます。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword "> |
| </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">XML ノードの接頭辞が解決される名前空間の URI です。 |
| |
| </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| XML ノードに接頭辞が付いている場合、<codeph class="+ topic/ph pr-d/codeph ">namespaceURI</codeph> はその接頭辞(URI)の <codeph class="+ topic/ph pr-d/codeph ">xmlns</codeph> 宣言の値となります。これは通常、名前空間 URI と呼ばれます。<codeph class="+ topic/ph pr-d/codeph ">xmlns</codeph> 宣言は、現在のノードか、XML 階層でそれより上位のノードにあります。 |
| |
| <p class="- topic/p ">XML ノードに接頭辞が付いていない場合、<codeph class="+ topic/ph pr-d/codeph ">namespaceURI</codeph> プロパティの値は、定義済みのデフォルトの名前空間(例えば <codeph class="+ topic/ph pr-d/codeph ">xmlns="http://www.example.com/"</codeph>)があるかどうかによって異なります。デフォルト名前空間がある場合、<codeph class="+ topic/ph pr-d/codeph ">namespaceURI</codeph> プロパティの値はデフォルトの名前空間の値です。デフォルトの名前空間がない場合、そのノードの <codeph class="+ topic/ph pr-d/codeph ">namespaceURI</codeph> プロパティは空のストリング(<codeph class="+ topic/ph pr-d/codeph ">""</codeph>)です。</p> |
| |
| <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">getNamespaceForPrefix()</codeph> メソッドを使用すると、特定の接頭辞に関連付けられている名前空間を特定できます。<codeph class="+ topic/ph pr-d/codeph ">namespaceURI</codeph> プロパティは、ノード名に関連付けられている接頭辞を返します。</p> |
| |
| </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.xml.xml#XMLNode/getNamespaceForPrefix()" class="- topic/link "><linktext class="- topic/linktext ">getNamespaceForPrefix()</linktext></link><link href="flash.xml.xml#XMLNode/getPrefixForNamespace()" class="- topic/link "><linktext class="- topic/linktext ">getPrefixForNamespace()</linktext></link></related-links></apiValue><apiValue id="flash.xml:XMLNode:prefix:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">prefix</apiName><shortdesc class="- topic/shortdesc "> |
| XML ノード名の接頭辞部分です。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword "> |
| </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| XML ノード名の接頭辞部分です。例えば、ノード <codeph class="+ topic/ph pr-d/codeph "><contact:mailbox/>bob@example.com</contact:mailbox></codeph> には、ローカル名 "mailbox" と接頭辞 "contact" があり、この 2 つで完全なエレメント名 "contact.mailbox" が構成されます。 |
| |
| <p class="- topic/p ">XML ノードオブジェクトの <codeph class="+ topic/ph pr-d/codeph ">nodeName</codeph> プロパティは、接頭辞とローカル名を含む完全な名前を返します。エレメント名のローカル名部分には、<codeph class="+ topic/ph pr-d/codeph ">localName</codeph> プロパティ経由でアクセスできます。 </p> |
| |
| |
| </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.xml:XMLNodeType" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">XMLNodeType</apiName><shortdesc class="- topic/shortdesc "> |
| XMLNodeType クラスには、XMLNode.nodeType で使用する定数があります。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| XMLNodeType クラスには、<codeph class="+ topic/ph pr-d/codeph ">XMLNode.nodeType</codeph> で使用する定数があります。値は、W3C DOM レベル 1 勧告(<xref href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html" scope="external" class="- topic/xref ">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html</xref>)の NodeType の一覧に定義されています。 |
| |
| </apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.xml.xml#XMLNode/nodeType" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.nodeType</linktext></link></related-links><apiValue id="flash.xml:XMLNodeType:ELEMENT_NODE" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">ELEMENT_NODE</apiName><shortdesc class="- topic/shortdesc "> |
| ノードがエレメントであることを指定します。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">1</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| ノードがエレメントであることを指定します。この定数は、<codeph class="+ topic/ph pr-d/codeph ">XMLNode.nodeType</codeph> で使用します。値は、W3C DOM レベル 1 勧告(<xref href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html" scope="external" class="- topic/xref ">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html</xref>)の NodeType の一覧に定義されています。 |
| |
| </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.xml.xml#XMLNode/nodeType" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.nodeType</linktext></link></related-links></apiValue><apiValue id="flash.xml:XMLNodeType:TEXT_NODE" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">TEXT_NODE</apiName><shortdesc class="- topic/shortdesc "> |
| ノードがテキストノードであることを指定します。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">3</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| ノードがテキストノードであることを指定します。この定数は、<codeph class="+ topic/ph pr-d/codeph ">XMLNode.nodeType</codeph> で使用します。値は、W3C DOM レベル 1 勧告(<xref href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html" scope="external" class="- topic/xref ">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html</xref>)の NodeType の一覧に定義されています。 |
| |
| </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.xml.xml#XMLNode/nodeType" class="- topic/link "><linktext class="- topic/linktext ">XMLNode.nodeType</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.xml:XMLDocument" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">XMLDocument</apiName><shortdesc class="- topic/shortdesc "> |
| XMLDocument クラスは、ActionScript 2.0 に存在していた古い XML オブジェクトを表します。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.xml:XMLNode</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| XMLDocument クラスは、ActionScript 2.0 にあった古い XML オブジェクトを表します。ActionScript 3.0 で新しい XML クラスと名前が競合しないように、ActionScript 3.0 では名前が XMLDocument に変更されています。ActionScript 3.0 では、E4X(ECMAScript for XML)をサポートしている新しい <xref href="../../XML.html" class="- topic/xref ">XML</xref> クラスおよび関連クラスを使用することをお勧めします。 |
| |
| <p class="- topic/p ">XMLDocument クラスと、XMLNode および XMLNodeType があるのは、後方互換性を維持するためです。XML ドキュメントをロードする機能は、現在では URLLoader クラスにあります。</p> |
| |
| </apiDesc><example conref="examples\XMLDocumentExample.as" class="- topic/example "> 次の例では、XMLDocument クラスおよび XMLNode クラスを使用し、XML ドキュメントを解析してフォーマットします。この例では、外部 XML ファイルをロードするのではなく、トップレベルの XML クラスを使用して、XML ドキュメントを作成し、これを解析します。 |
| <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock "> |
| package { |
| import flash.display.Sprite; |
| import flash.xml.XMLDocument; |
| import flash.xml.XMLNode; |
| import flash.xml.XMLNodeType; |
| |
| public class XMLDocumentExample extends Sprite { |
| public function XMLDocumentExample() { |
| var result:XMLDocument = new XMLDocument(); |
| result.ignoreWhite = true; |
| result.parseXML(getXMLString()); |
| |
| var books:Array = parseBooks(result.firstChild); |
| trace("books: \n" + books); |
| } |
| |
| private function parseBooks(node:XMLNode):Array { |
| var books:Array = new Array(); |
| |
| var kids:Array = node.childNodes; |
| for each(var item:XMLNode in kids) { |
| parseBook(item, books); |
| } |
| |
| return books; |
| } |
| |
| private function parseBook(node:XMLNode, books:Array):void { |
| var item:Book = new Book(); |
| item.setPublisher(node.attributes.publisher); |
| item.setName(node.attributes.name); |
| books.push(item); |
| } |
| |
| private function getXMLString():String { |
| var list:XML = <books> |
| <book publisher="Addison-Wesley" name="Design Patterns" /> |
| <book publisher="Addison-Wesley" name="The Pragmatic Programmer" /> |
| <book publisher="Addison-Wesley" name="Test Driven Development" /> |
| <book publisher="Addison-Wesley" name="Refactoring to Patterns" /> |
| <book publisher="O'Reilly Media" name="The Cathedral & the Bazaar" /> |
| <book publisher="O'Reilly Media" name="Unit Test Frameworks" /> |
| </books>; |
| return list.toXMLString(); |
| } |
| } |
| |
| } |
| class Book { |
| private var publisher:String; |
| private var name:String; |
| |
| public function setPublisher(publisher:String):void { |
| this.publisher = publisher; |
| } |
| |
| public function setName(name:String):void { |
| this.name = name; |
| } |
| |
| public function toString():String { |
| return "[Book name: " + name + " publisher: " + publisher + "]\n"; |
| } |
| } |
| </codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLLoader" class="- topic/link "><linktext class="- topic/linktext ">flash.net.URLLoader</linktext></link><link href="#XML" class="- topic/link "><linktext class="- topic/linktext ">XML クラス</linktext></link></related-links><apiConstructor id="flash.xml:XMLDocument:XMLDocument" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">XMLDocument</apiName><shortdesc class="- topic/shortdesc "> |
| 新しい XMLDocument オブジェクトを作成します。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates a new, empty XMLDocument object: |
| <listing> |
| var my_xml:XML = new XML(); |
| </listing> |
| <p class="- topic/p ">The following example creates an XML object by parsing the XML text specified in the <code>source</code> parameter, and populates the newly created XML object with the resulting XML document tree:</p> |
| <listing> |
| var other_xml:XML = new XML("<state name=\"California\"><city>San Francisco</city></state>"); |
| </listing> |
| |
| </maelexample></asCustoms></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">source</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">新しい XMLDocument オブジェクトを作成するために解析される XML テキストです。 |
| |
| </apiDesc></apiParam></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| 新しい XMLDocument オブジェクトを作成します。XMLDocument クラスのメソッドを呼び出す前に、コンストラクターを使用して XMLDocument オブジェクトを作成する必要があります。 |
| <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意:XML ドキュメントツリーにエレメントとテキストノードを追加するには、</b><codeph class="+ topic/ph pr-d/codeph ">createElement()</codeph> メソッドおよび <codeph class="+ topic/ph pr-d/codeph ">createTextNode()</codeph> メソッドを使用します。</p> |
| |
| </apiDesc></apiConstructorDetail><related-links class="- topic/related-links "><link href="flash.xml.xml#XMLDocument/createElement()" class="- topic/link "><linktext class="- topic/linktext ">XMLDocument.createElement()</linktext></link><link href="flash.xml.xml#XMLDocument/createTextNode()" class="- topic/link "><linktext class="- topic/linktext ">XMLDocument.createTextNode()</linktext></link></related-links></apiConstructor><apiOperation id="flash.xml:XMLDocument:createElement" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">createElement</apiName><shortdesc class="- topic/shortdesc "> |
| パラメーターで指定された名前を持つ新しい XMLNode オブジェクトを作成します。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates three XML nodes using the <code>createElement()</code> method: |
| <listing> |
| // create an XML document |
| var doc:XML = new XML(); |
| |
| // create three XML nodes using createElement() |
| var element1:XMLNode = doc.createElement("element1"); |
| var element2:XMLNode = doc.createElement("element2"); |
| var element3:XMLNode = doc.createElement("element3"); |
| |
| // place the new nodes into the XML tree |
| doc.appendChild(element1); |
| element1.appendChild(element2); |
| element1.appendChild(element3); |
| |
| trace(doc); |
| // output: <element1><element2 /><element3 /></element1> |
| </listing> |
| |
| </maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">XMLNode オブジェクトです。 |
| |
| </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.xml:XMLNode</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">name</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">作成する XMLDocument エレメントのタグ名です。 |
| |
| </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| パラメーターで指定された名前を持つ新しい XMLNode オブジェクトを作成します。初期状態では、新しいノードには、親、子、および兄弟はありません。このメソッドは、エレメントとして新しく作成された XMLNode オブジェクトへの参照を返します。このメソッドと <codeph class="+ topic/ph pr-d/codeph ">XMLDocument.createTextNode()</codeph> メソッドは、XMLDocument オブジェクトのノードを作成するためのコンストラクターメソッドです。 |
| |
| </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.xml.xml#XMLDocument/createTextNode()" class="- topic/link "><linktext class="- topic/linktext ">XMLDocument.createTextNode()</linktext></link></related-links></apiOperation><apiOperation id="flash.xml:XMLDocument:createTextNode" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">createTextNode</apiName><shortdesc class="- topic/shortdesc "> |
| 指定されたテキストを持つ新しい XML テキストノードを作成します。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates two XML text nodes using the <code>createTextNode()</code> method, and places them into existing XML nodes: |
| <listing> |
| // create an XML document |
| var doc:XML = new XML(); |
| |
| // create three XML nodes using createElement() |
| var element1:XMLNode = doc.createElement("element1"); |
| var element2:XMLNode = doc.createElement("element2"); |
| var element3:XMLNode = doc.createElement("element3"); |
| |
| // place the new nodes into the XML tree |
| doc.appendChild(element1); |
| element1.appendChild(element2); |
| element1.appendChild(element3); |
| |
| // create two XML text nodes using createTextNode() |
| var textNode1:XMLNode = doc.createTextNode("textNode1 String value"); |
| var textNode2:XMLNode = doc.createTextNode("textNode2 String value"); |
| |
| // place the new nodes into the XML tree |
| element2.appendChild(textNode1); |
| element3.appendChild(textNode2); |
| |
| trace(doc); |
| // output (with line breaks added between tags): |
| // <element1> |
| // <element2>textNode1 String value</element2> |
| // <element3>textNode2 String value</element3> |
| // </element1> |
| </listing> |
| |
| |
| </maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">XMLNode オブジェクトです。 |
| |
| </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.xml:XMLNode</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">text</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">新しいテキストノードを作成するためのテキストです。 |
| |
| </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| 指定されたテキストを持つ新しい XML テキストノードを作成します。初期状態では、新しいノードには親がありません。また、テキストノードは、子または兄弟を持つことができません。このメソッドは、新しいテキストノードを表す XMLDocument オブジェクトへの参照を返します。このメソッドと <codeph class="+ topic/ph pr-d/codeph ">XMLDocument.createElement()</codeph> メソッドは、XMLDocument オブジェクトのノードを作成するためのコンストラクターメソッドです。 |
| |
| |
| </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.xml.xml#XMLDocument/createElement()" class="- topic/link "><linktext class="- topic/linktext ">XMLDocument.createElement()</linktext></link></related-links></apiOperation><apiOperation id="flash.xml:XMLDocument:parseXML" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">parseXML</apiName><shortdesc class="- topic/shortdesc "> |
| value パラメーターで指定された XML テキストを解析し、指定された XMLDocument オブジェクトに XML ツリーを設定します。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates and parses an XML packet: |
| <listing> |
| var xml_str:String = "<state name=\"California\"> |
| <city>San Francisco</city></state>" |
| |
| // defining the XML source within the XML constructor: |
| var my1_xml:XML = new XML(xml_str); |
| trace(my1_xml.firstChild.attributes.name); // output: California |
| |
| // defining the XML source using the XML.parseXML method: |
| var my2_xml:XML = new XML(); |
| my2_xml.parseXML(xml_str); |
| trace(my2_xml.firstChild.attributes.name); // output: California |
| </listing> |
| |
| </maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">source</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">解析され、指定した XMLDocument オブジェクトに渡される XML テキストです。 |
| |
| </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| <codeph class="+ topic/ph pr-d/codeph ">value</codeph> パラメーターで指定された XML テキストを解析し、指定された XMLDocument オブジェクトに XML ツリーを設定します。XMLDocument オブジェクト内の既存のツリーはすべて破棄されます。 |
| |
| </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.xml:XMLDocument:toString" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">toString</apiName><shortdesc class="- topic/shortdesc "> |
| XML オブジェクトのストリング表現を返します。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiIsOverride class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiIsOverride "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">XML オブジェクトのストリング表現です。 |
| |
| </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| XML オブジェクトのストリング表現を返します。 |
| |
| </apiDesc></apiOperationDetail></apiOperation><apiValue id="flash.xml:XMLDocument:docTypeDecl" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">docTypeDecl</apiName><shortdesc class="- topic/shortdesc "> |
| XML ドキュメントの DOCTYPE 宣言についての情報を指定します。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example uses the <code>XML.docTypeDecl</code> property to set the <code>DOCTYPE</code> declaration for an XML object: |
| <listing> |
| <code><em>my_xml</em></code>.<code>docTypeDecl = "<!DOCTYPE greeting SYSTEM \"hello.dtd\">";</code> |
| </listing> |
| </maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Object</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| XML ドキュメントの <codeph class="+ topic/ph pr-d/codeph ">DOCTYPE</codeph> 宣言についての情報を指定します。XML テキストが解析され XMLDocument オブジェクトになると、XMLDocument オブジェクトの <codeph class="+ topic/ph pr-d/codeph ">XMLDocument.docTypeDecl</codeph> プロパティはその XML ドキュメントの <codeph class="+ topic/ph pr-d/codeph ">DOCTYPE</codeph> 宣言(例えば <codeph class="+ topic/ph pr-d/codeph "><!DOCTYPE</codeph> <codeph class="+ topic/ph pr-d/codeph ">greeting SYSTEM "hello.dtd"></codeph> など)のテキストに設定されます。 このプロパティは、XMLNode オブジェクトでなく <codeph class="+ topic/ph pr-d/codeph ">DOCTYPE</codeph> 宣言のストリング表現を使用して設定されます。 |
| <p class="- topic/p ">古い ActionScript の XML パーサーは、妥当性検証用パーサーではありません。<codeph class="+ topic/ph pr-d/codeph ">DOCTYPE</codeph> 宣言はパーサーにより読み取られ、<codeph class="+ topic/ph pr-d/codeph ">XMLDocument.docTypeDecl</codeph> プロパティに格納されますが、DTD の妥当性検査は行われません。</p> |
| <p class="- topic/p ">解析中に <codeph class="+ topic/ph pr-d/codeph ">DOCTYPE</codeph> 宣言が見つからなかった場合、<codeph class="+ topic/ph pr-d/codeph ">XMLDocument.docTypeDecl</codeph> プロパティは <codeph class="+ topic/ph pr-d/codeph ">null</codeph> に設定されます。<codeph class="+ topic/ph pr-d/codeph ">XML.toString()</codeph> メソッドは、<codeph class="+ topic/ph pr-d/codeph ">XML.docTypeDecl</codeph> の内容を、<codeph class="+ topic/ph pr-d/codeph ">XML.xmlDecl</codeph> に保存されている XML 宣言のすぐ後、XML オブジェクト内の他のテキストよりも前に出力します。<codeph class="+ topic/ph pr-d/codeph ">XMLDocument.docTypeDecl</codeph> が null である場合、<codeph class="+ topic/ph pr-d/codeph ">DOCTYPE</codeph> 宣言は出力されません。</p> |
| </apiDesc></apiValueDetail></apiValue><apiValue id="flash.xml:XMLDocument:idMap" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">idMap</apiName><shortdesc class="- topic/shortdesc "> |
| id 属性が割り当てられた XML のノードを含むオブジェクトです。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>Create a text file named "idMapTest.xml" containing the following text: |
| |
| <listing><?xml version="1.0"?> |
| <doc xml:base="http://example.org/today/" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| <head> |
| <title>Virtual Library</title> |
| </head> |
| <body> |
| <paragraph id="linkP1">See <link xlink:type="simple" xlink:href="new.xml">what's |
| new</link>!</paragraph> |
| <paragraph>Check out the hot picks of the day!</paragraph> |
| <olist xml:base="/hotpicks/"> |
| <item> |
| <link id="foo" xlink:type="simple" xlink:href="pick1.xml">Hot Pick #1</link> |
| </item> |
| <item> |
| <link id="bar" xlink:type="simple" xlink:href="pick2.xml">Hot Pick #2</link> |
| </item> |
| <item> |
| <link xlink:type="simple" xlink:href="pick3.xml">Hot Pick #3</link> |
| </item> |
| </olist> |
| </body> |
| </doc> |
| </listing> |
| |
| <p class="- topic/p ">Then create a SWF file in the same directory as the XML file. Include the following |
| script in the SWF:</p> |
| |
| <listing> |
| var readXML = new XMLDocument(); |
| readXML.load("idMapTest.xml"); |
| readXML.onLoad = function(success) { |
| myXML = new XMLDocument(); |
| myXML.parseXML(readXML); |
| for (var x in myXML.idMap){ |
| trace('idMap.' + x + " = " + newline + myXML.idMap[x]); |
| trace('____________' + newline); |
| } |
| } |
| </listing> |
| |
| <p class="- topic/p ">When you test the SWF file, the following output is generated:</p> |
| |
| <listing> |
| idMap.bar = |
| <link id="bar" xlink:type="simple" xlink:href="pick2.xml">Hot Pick #2</link> |
| ____________ |
| |
| idMap.foo = |
| <link id="foo" xlink:type="simple" xlink:href="pick1.xml">Hot Pick #1</link> |
| ____________ |
| |
| idMap.linkP1 = |
| <paragraph id="linkP1">See <link xlink:type="simple" xlink:href="new.xml">what's |
| |
| new</link>!</paragraph> |
| ____________ |
| </listing> |
| |
| </maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">unknown</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Object</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| <codeph class="+ topic/ph pr-d/codeph ">id</codeph> 属性が割り当てられた XML のノードを含むオブジェクトです。ノードを格納する各オブジェクトのプロパティの名前は <codeph class="+ topic/ph pr-d/codeph ">id</codeph> 属性の値に一致します。 |
| |
| <p class="- topic/p ">例えば、次のような XMLDocument オブジェクトを検討します。</p> |
| |
| <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock "> |
| <employee id='41'> |
| <name> |
| John Doe |
| </name> |
| <address> |
| 601 Townsend St. |
| </address> |
| </employee> |
| |
| <employee id='42'> |
| <name> |
| Jane Q. Public |
| </name> |
| </employee> |
| <department id="IT"> |
| Information Technology |
| </department> |
| </codeblock> |
| |
| <p class="- topic/p ">この例では、この XMLDocument オブジェクトの <codeph class="+ topic/ph pr-d/codeph ">idMap</codeph> プロパティは、<codeph class="+ topic/ph pr-d/codeph ">41</codeph>、<codeph class="+ topic/ph pr-d/codeph ">42</codeph> および <codeph class="+ topic/ph pr-d/codeph ">IT</codeph> という 3 つのプロパティを持つオブジェクトです。これらのプロパティはそれぞれ対応する <codeph class="+ topic/ph pr-d/codeph ">id</codeph> 値を持つ XMLNode です。例えば、<codeph class="+ topic/ph pr-d/codeph ">IT</codeph> プロパティ(<codeph class="+ topic/ph pr-d/codeph ">idMap</codeph> オブジェクトのプロパティ)は次のノードになります。</p> |
| |
| <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock "> |
| <department id="IT"> |
| Information Technology |
| </department> |
| </codeblock> |
| |
| <p class="- topic/p ">XMLDocument オブジェクトの <codeph class="+ topic/ph pr-d/codeph ">parseXML()</codeph> メソッドを使用して、<codeph class="+ topic/ph pr-d/codeph ">idMap</codeph> プロパティをインスタンス化する必要があります。</p> |
| |
| <p class="- topic/p ">同じ <codeph class="+ topic/ph pr-d/codeph ">id</codeph> 値を持つ XMLNode が複数ある場合は、<codeph class="+ topic/ph pr-d/codeph ">idNode</codeph> オブジェクトの対応するプロパティは、解析された最後のノードのプロパティです。次に実際の使用例を示します。</p> |
| |
| <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock "> |
| var x1:XML = new XMLDocument("<a id='1'><b id='2' /><c id='1' /></a>"); |
| x2 = new XMLDocument(); |
| x2.parseXML(x1); |
| trace(x2.idMap['1']); |
| </codeblock> |
| |
| これによって、<codeph class="+ topic/ph pr-d/codeph "><c></codeph> ノードが出力されます。 |
| |
| <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock "> |
| <codeph class="+ topic/ph pr-d/codeph "><c id='1' /></codeph> |
| </codeblock> |
| |
| </apiDesc></apiValueDetail></apiValue><apiValue id="flash.xml:XMLDocument:ignoreWhite" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">ignoreWhite</apiName><shortdesc class="- topic/shortdesc "> |
| true を設定すると、空白のみを含むテキストノードは解析処理中に破棄されます。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example loads an XML file with a text node that contains only white space; the <code>foyer</code> tag comprises fourteen space characters. To run this example, create a text file named <em>flooring.xml</em>, and copy the following tags into it: |
| <listing> |
| <house> |
| <kitchen> ceramic tile </kitchen> |
| <bathroom>linoleum</bathroom> |
| <foyer> </foyer> |
| </house> |
| </listing> |
| <p class="- topic/p ">Create a new Flash document named <em>flooring.fla</em> and save it to the same directory as the XML file. Place the following code into the main Timeline:</p> |
| <listing> |
| // create a new XML object |
| var flooring:XML = new XML(); |
| |
| // set the ignoreWhite property to true (default value is false) |
| flooring.ignoreWhite = true; |
| |
| // After loading is complete, trace the XML object |
| flooring.onLoad = function(success:Boolean) { |
| trace(flooring); |
| } |
| |
| // load the XML into the flooring object |
| flooring.load("flooring.xml"); |
| |
| // output (line breaks added for clarity): |
| <house> |
| <kitchen> ceramic tile </kitchen> |
| <bathroom>linoleum</bathroom> |
| <foyer /> |
| </house> |
| |
| </listing> |
| <p class="- topic/p ">If you then change the setting of <code>flooring.ignoreWhite</code> to <code>false</code>, or simply remove that line of code entirely, the fourteen space characters in the <code>foyer</code> tag will be preserved:</p> |
| <listing> |
| ... |
| // set the ignoreWhite property to false (default value) |
| flooring.ignoreWhite = false; |
| ... |
| // output (line breaks added for clarity): |
| <house> |
| <kitchen> ceramic tile </kitchen> |
| <bathroom>linoleum</bathroom> |
| <foyer> </foyer> |
| </house> |
| |
| </listing> |
| <span class="flashonly"><p class="- topic/p ">The XML_blogTracker.fla and XML_languagePicker.fla files in the ActionScript samples folder also contain a code example. The following are typical paths to this folder:</p> |
| <ul class="- topic/ul "><li class="- topic/li ">Windows: <i class="+ topic/ph hi-d/i ">boot drive</i>\Program Files\Macromedia\Flash 8\Samples and Tutorials\Samples\ActionScript </li><li class="- topic/li ">Macintosh: <i class="+ topic/ph hi-d/i ">Macintosh HD</i>/Applications/Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript </li><li class="- topic/li "/></ul> |
| </span> |
| </maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">false</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| <codeph class="+ topic/ph pr-d/codeph ">true</codeph> を設定すると、空白のみを含むテキストノードは解析処理中に破棄されます。先頭または末尾に空白があるテキストノードは影響を受けません。デフォルト設定は、<codeph class="+ topic/ph pr-d/codeph ">false</codeph> です。 |
| <p class="- topic/p ">次のコードに示すように、XMLDocument オブジェクトごとに <codeph class="+ topic/ph pr-d/codeph ">ignoreWhite</codeph> プロパティを設定できます。</p> |
| <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock "> |
| my_xml.ignoreWhite = true; |
| </codeblock> |
| |
| </apiDesc></apiValueDetail></apiValue><apiValue id="flash.xml:XMLDocument:xmlDecl" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">xmlDecl</apiName><shortdesc class="- topic/shortdesc "> |
| ドキュメントの XML 宣言についての情報を指定するストリングです。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates a text field called <code>my_txt</code> |
| that has the same dimensions as the Stage. The text field displays properties of the XML packet that loads into the SWF file. The doc type declaration displays in <code>my_txt</code>. Add the following ActionScript to your FLA or AS file: |
| <listing> |
| <code>var my_fmt:TextFormat = new TextFormat();</code> |
| <code>my_fmt.font = "_typewriter";</code> |
| <code>my_fmt.size = 12;</code> |
| <code>my_fmt.leftMargin = 10;</code> |
| |
| <code>this.createTextField("my_txt", this.getNextHighestDepth(), 0, 0, Stage.width, Stage.height);</code> |
| <code>my_txt.border = true;</code> |
| <code>my_txt.multiline = true;</code> |
| <code>my_txt.wordWrap = true;</code> |
| <code>my_txt.setNewTextFormat(my_fmt);</code> |
| |
| <code>var my_xml:XML = new XML();</code> |
| <code>my_xml.ignoreWhite = true;</code> |
| <code>my_xml.onLoad = function(success:Boolean) {</code> |
| <code> var endTime:Number = getTimer();</code> |
| <code> var elapsedTime:Number = endTime-startTime;</code> |
| <code> if (success) {</code> |
| <code> my_txt.text = "xmlDecl:"+newline+my_xml.xmlDecl+newline+newline;</code> |
| <code> my_txt.text += "contentType:"+newline+my_xml.contentType+newline+newline;</code> |
| <code> my_txt.text += "docTypeDecl:"+newline+my_xml.docTypeDecl+newline+newline;</code> |
| <code> my_txt.text += "packet:"+newline+my_xml.toString()+newline+newline;</code> |
| <code> } else {</code> |
| <code> my_txt.text = "Unable to load remote XML."+newline+newline;</code> |
| <code> }</code> |
| <code> my_txt.text += "loaded in: "+elapsedTime+" ms.";</code> |
| <code>};</code> |
| <code>my_xml.load("http://www.helpexamples.com/crossdomain.xml");</code> |
| <code>var startTime:Number = getTimer();</code> |
| </listing> |
| </maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Object</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> |
| ドキュメントの XML 宣言についての情報を指定するストリングです。XML ドキュメントが XMLDocument オブジェクトに解析された後、このプロパティはドキュメントの XML 宣言のテキストに設定されます。このプロパティは、XMLNode オブジェクトでなく XML 宣言のストリング表現を使用して設定されます。解析中に XML 宣言が見つからなかった場合、プロパティは <codeph class="+ topic/ph pr-d/codeph ">null</codeph> に設定されます。<codeph class="+ topic/ph pr-d/codeph ">XMLDocument.toString()</codeph> メソッドは、XML オブジェクト内の他のテキストの前に、<codeph class="+ topic/ph pr-d/codeph ">XML.xmlDecl</codeph> プロパティの内容を出力します。<codeph class="+ topic/ph pr-d/codeph ">XML.xmlDecl</codeph> プロパティに <codeph class="+ topic/ph pr-d/codeph ">null</codeph> が含まれている場合、XML 宣言は出力されません。 |
| </apiDesc></apiValueDetail></apiValue></apiClassifier></apiPackage> |