Processing Instruction: Difference between revisions

Content deleted Content added
m Turn first ref (bare HTML link) into real Template:Cite book citation
Citation bot (talk | contribs)
Add: title, year. Changed bare reference to CS1/2. Removed parameters. | Use this bot. Report bugs. | Suggested by BrownHairedGirl | Linked from User:BrownHairedGirl/Articles_with_bare_links | #UCB_webform_linked 1058/2195
Line 9:
<syntaxhighlight lang="xml"><?PITarget PIContent?></syntaxhighlight>
 
The [[XHTML#XML declaration|XML Declaration]] at the beginning of an XML document (shown below) is '''not''' a processing instruction, however its similar syntax has often resulted in it being referred to as a processing instruction.<ref name="nutshell">{{cite book | title = XML in a nutshell | author = Elliotte Rusty Harold, W. Scott Means | year = 2004 | isbn = 978-0-596-00764-5 | page = 23 }}</ref>
<syntaxhighlight lang="xml"><?xml version="1.0" encoding="UTF-8" ?></syntaxhighlight>
 
== Examples ==
The most common use of a processing instruction is to request the XML document be rendered using a [[Extensible Stylesheet Language|stylesheet]] using the 'xml-stylesheet' target, which was standardized in 1999.<ref>{{Cite web|url=http://www.w3.org/TR/xml-stylesheet/|title=Associating Style Sheets with XML documents 1.0 (Second Edition)}}</ref> It can be used for both [[XSLT]] and [[Cascading Style Sheet|CSS]] stylesheets.
<syntaxhighlight lang="xml"><?xml-stylesheet type="text/xsl" href="style.xsl"?></syntaxhighlight>
<syntaxhighlight lang="xml"><?xml-stylesheet type="text/css" href="style.css"?></syntaxhighlight>
 
The [[DocBook]] XSLT stylesheets understand a number of processing instructions to override the default behaviour.<ref>{{Cite web|url=http://docbook.sourceforge.net/release/xsl/current/doc/pi/pi-fo.html|title = Part 2. FO Processing Instruction Reference}}</ref>
 
A draft specification for [[Robots exclusion standard]] rules inside XML documents uses processing instructions.<ref>{{cite web |url=http://www.atrus.org/writings/technical/robots_pi/ |title=Archived copy |accessdate=2010-08-18 |url-status=dead|archiveurl=https://web.archive.org/web/20100921021126/http://www.atrus.org/writings/technical/robots_pi/ |archivedate=2010-09-21 |df= }}</ref>
 
== References ==