• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSXMLDocument question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSXMLDocument question


  • Subject: Re: NSXMLDocument question
  • From: Ilan Volow <email@hidden>
  • Date: Thu, 2 Mar 2006 08:40:54 -0500


Off the top-of-my-head, I'd say what you should do would be to call NSXMLNode's processingInstructionWithName:stringValue method to get yourself a processing instruction node, and then add this node to your NSXMLDocument.



-- Ilan

On Mar 2, 2006, at 7:13 AM, malcom wrote:

Hello, I need to generate an XML Document from some NSString. Then,
the xml string will be transmitted to an XSLT document and finally it
will be rendered by WebKit.
But I have a problem...
NSXMLDocument can generate a document like this:

<?xml version="1.0" encoding="utf-8"?>
<ROOT KEY>
..
..

But I need to put this string:
<?xml-stylesheet type="text/xsl" href="template.xsl" ?>

after the first line and pass all to browser. How can I add it? Is possible?
I have found this on ADC:
file:///Developer/ADC Reference Library/documentation/Cocoa/ Conceptual/NSXML_Concepts/Articles/WritingXML.html#//apple_ref/doc/ uid/TP40001256


"...NSXML includes support for XSLT. With XSLT you can apply a set of
template rules and patterns to a source XML document and thereby
transform that document into another XML document or into an HTML,
RTF, or plain-text document. Two NSXMLDocument methods are the
interface to XSLT processing:

- (id)objectByApplyingXSLT:(NSString *)xslt error:(NSError **)error
- (id)objectByApplyingXSLTAtURL:(NSURL *)xsltURL error:(NSError **) error"


Is this a better way to do it?
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: NSXMLDocument question
      • From: Robert Walker <email@hidden>
References: 
 >NSXMLDocument question (From: malcom <email@hidden>)

  • Prev by Date: Resizable inline images in NSTextView
  • Next by Date: Re: Need HELP - Dragging a view
  • Previous by thread: NSXMLDocument question
  • Next by thread: Re: NSXMLDocument question
  • Index(es):
    • Date
    • Thread