Hey everybody, I've got an issue that I can't figure out.

If I'm using this code:

NSString *XMLForDisplay {

  NSXMLElement *root = [NSXMLNode elementWithName:@"root"];
[root addNamespace:[NSXMLNode namespaceWithName:@"a" stringValue:@"http://www.tempurl.com "]];

NSXMLElement *child = [NSXMLNode elementWithName:@"child" URI:@"http://www.tempurl.com "];
  [child addChild:[NSXMLNode textWithStringValue:@"myText"]];

  [root addChild:child];

  return [root XMLStringWithOptions:NSXMLNodePrettyPrint];
}


I believe it should be outputting this text:

<root xmlns:a="http://www.tempurl.com";>
  <a:child>myText</a:child>
</root>

However, instead it outputs this text (note the lack of prefix on the child):

<root xmlns:a="http://www.tempurl.com";>
  <child>myText</child>
</root>

This is an issue, because I need that "a:" prefix.

The documentation for elementWithName:URI: states it's equivalent to <URI:name></URI:name>, which is exactly what I want, except that I can't get it to display that way.

Thanks for your time.
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to