問題タブ [nsxmldocument]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
xml-parsing - カスタム オブジェクトへの NSXMLDocument 解析
XPath を使用せずに NSXMLDocument を使用して、XML ドキュメントを解析し、それをカスタム オブジェクトに逆シリアル化してオブジェクト ツリー階層を作成する簡単な方法はありますか?
たとえば、以下に示す xml がある場合、詳細をレストラン オブジェクトとその中のコンテンツ オブジェクトに入れることは可能ですか?
上記の回答を使用して、iOSのkissxmlでプログラミングできるように拡張します。KissXML ドキュメントで、XML パーサーは NSXMLDocument と同じように動作することが言及されているので、NSXMLDocument を使用して質問しました。
ios - How to write xml with objective-c and place it into an NSData object
I have been reading through heaps of the ios docs from Apple, and almost every bit of code to do with xml on there requires either creating a file with xml data in it or receiving xml over a connection then altering it.
I would like to know if there is a way to just create some xml.. maybe in a string, then convert it into a NSData object.. I know how to pass a NSString into a NSData object.. thats not so much of a big deal.. the painful part at the moment is getting some clear concise examples on how to create my own xml without all the other stuff that Apple says you need.. I.e. file or return data.
I currently have no code.. what I will likely do is create a method with some parameters that can receive some information and then pass them in to hopefully create a nice xml string/data object.
objective-c - これはどのような種類の XML ファイルですか?
すべての州のポイントを含むファイルがあります。各状態のオーバーレイを作成できるように解析したい。そのxmlだと思いますが、element_data形式の従来のものではありません。
誰かがそのplist xmlについて言及しました。
このタイプのデータを解析する最良の方法は何ですか:
xml - Encoding Line Feed Characters in the value of a NSXMLElement's attribute
The comment field of an XML database I'm reading and writing is stored as the attribute of an NSXMLElement. One entry contains a line feed (0x0a) character. These are encoded by a non NSXML encoder in the document I'm parsing as 

and get parsed correctly by NSXML. They result in the NSString containing the unicode value 0x0a 0x00 in memory (intel byte ordering).
For example:
When writing this NSString back out as the value of an NSXMLElement's attribute, it does not get encoded back and results in the following being output to the xml file:
which of course does not get parsed properly upon re-reading the file again.
It seems like node options like NSXMLNodePreserveCharacterReferences
or NSXMLNodePreserveEntities
should be the way to go but it doesn't seem to help in any way.
I must be missing the obvious but I've been stuck on this all day.
objective-c - CocoaでのNSXML検索
この外部XMLファイルがある場合:
「Adobe」のコンテンツを取得して配列に入れたいとしたら、どうすればよいですか?
次のものがあり、「<name>」の配列が表示されますが、次のステップがわかりません。
ads_xmlはNSXMLDocumentタイプです。
ありがとう!
PS具体的には、<ドライバー>ノードの下にある<名前>と<ファイル名>が必要です。乾杯
objective-c - solo タグ付きの NSXMLElement 。すなわち。
単独のタグ (つまり、個別の終了タグのないタグ) を含む必要がある XML 文字列を作成しようとしています。次のような通常の xml タグを作成できます。
コードを使用して
しかし、私はこのようにそれが必要です
objective-c - NSXMLDocument .xml への書き込み
9行目の「< taskinprogress>」行でファイルが正しくフォーマットされない理由を知っている人はいますか。「< project>」を「< taskinprogress>」と同じ行に配置しますが、その理由がわかりません。「< project>」を次の行に移動したいです (文字列に \n 文字を追加せずに)。
以下は、すべてのノードと要素を宣言する私のコードです。
objective-c - NSXMLDocument ノードから属性情報を取得する
この xml ドキュメントを cocoa と Objective C で解析する方法を見つけようとして、数日間壁に頭をぶつけてきました。それを NSXMLDocument にロードし、ノードを取得することができました。
XML ドキュメントが複雑なのは、各ノードに複数の属性があることです。したがって、[node XMLString] に移動すると、まだ意味のない完全な文字列が返されます。ノードから単一の属性を取得する方法はありますか?たとえば、getAttribute("Size") は値 4 の文字列を返します。
どんな助けでも大歓迎です。
objective-c - Cocoaでxmlファイルを開く際のエラーを取り除く方法
Cocoa xml 読み取り書き込みコーディングを開始するために、サンプル アプリケーションを作成しました。このアプリケーションでは、XML ファイルに書き込むことはできますが、読み取りでエラーが発生します。以下はそのためのコードです。
これは正常に機能し、book.xml が作成されます。しかし、このファイルを読み取ろうとすると、このファイルを開く際に問題が発生します。これがそのコードです。
xmlDoc の値は nil です。
あなたの答えは高く評価されます。
ありがとう、タウシフ。