fbpx
Wikipedia

Processing Instruction

A processing instruction (PI) is an SGML and XML node type, which may occur anywhere in a document, intended to carry instructions to the application.[1][2]

Processing instructions are exposed in the Document Object Model as Node.PROCESSING_INSTRUCTION_NODE, and they can be used in XPath and XQuery with the 'processing-instruction()' command.

Syntax edit

An SGML processing instruction is enclosed within <? and >.[3]

An XML processing instruction is enclosed within <? and ?>, and contains a target and optionally some content, which is the node value, that cannot contain the sequence ?>.[4]

<?PITarget PIContent?> 

The XML Declaration at the beginning of an XML document (shown below) is another example of a processing instruction,[5] however it may not technically be considered one.[6]

<?xml version="1.0" encoding="UTF-8" ?> 

Examples edit

The most common use of a processing instruction is to request the XML document be rendered using a stylesheet using the 'xml-stylesheet' target, which was standardized in 1999.[7] It can be used for both XSLT and CSS stylesheets.

<?xml-stylesheet type="text/xsl" href="style.xsl"?> 
<?xml-stylesheet type="text/css" href="style.css"?> 

The DocBook XSLT stylesheets understand a number of processing instructions to override the default behaviour.[8]

A draft specification for Robots exclusion standard rules inside XML documents uses processing instructions.[9]

References edit

  1. ^ Stayton, Bob (September 2007). "Chapter 9. Customization methods §Processing instructions". DocBook XSL: The Complete Guide. Sagehill Enterprises. ISBN 978-0974152134.
  2. ^ Comparison of SGML and XML; World Wide Web Consortium Note, 15 December 1997
  3. ^ Bryan, Martin (1997). SGML and HTML Explained. Addison Wesley Longman. ISBN 0-201-40394-3. Retrieved 2010-08-18.
  4. ^ Hossein Bidgoli (2004). The Internet encyclopedia, Volume 3. John Wiley and Sons. p. 877. ISBN 0-471-22203-8.
  5. ^ "XML 1.0 - slide "Processing Instructions (PIs)"". www.w3.org. Retrieved 2023-02-08.
  6. ^ Elliotte Rusty Harold, W. Scott Means (2004). XML in a nutshell. p. 23. ISBN 978-0-596-00764-5.
  7. ^ "Associating Style Sheets with XML documents 1.0 (Second Edition)".
  8. ^ "Part 2. FO Processing Instruction Reference".
  9. ^ . Archived from the original on 2010-09-21. Retrieved 2010-08-18.

External links edit

  • XML specification section: Processing Instructions
  • , Dave Pawson
  • xslt:processing-instruction, Mozilla

processing, instruction, processing, instruction, sgml, node, type, which, occur, anywhere, document, intended, carry, instructions, application, processing, instructions, exposed, document, object, model, node, processing, instruction, node, they, used, xpath. A processing instruction PI is an SGML and XML node type which may occur anywhere in a document intended to carry instructions to the application 1 2 Processing instructions are exposed in the Document Object Model as Node PROCESSING INSTRUCTION NODE and they can be used in XPath and XQuery with the processing instruction command Contents 1 Syntax 2 Examples 3 References 4 External linksSyntax editAn SGML processing instruction is enclosed within lt and gt 3 An XML processing instruction is enclosed within lt and gt and contains a target and optionally some content which is the node value that cannot contain the sequence gt 4 lt PITarget PIContent gt The XML Declaration at the beginning of an XML document shown below is another example of a processing instruction 5 however it may not technically be considered one 6 lt xml version 1 0 encoding UTF 8 gt Examples editThe most common use of a processing instruction is to request the XML document be rendered using a stylesheet using the xml stylesheet target which was standardized in 1999 7 It can be used for both XSLT and CSS stylesheets lt xml stylesheet type text xsl href style xsl gt lt xml stylesheet type text css href style css gt The DocBook XSLT stylesheets understand a number of processing instructions to override the default behaviour 8 A draft specification for Robots exclusion standard rules inside XML documents uses processing instructions 9 References edit Stayton Bob September 2007 Chapter 9 Customization methods Processing instructions DocBook XSL The Complete Guide Sagehill Enterprises ISBN 978 0974152134 Comparison of SGML and XML World Wide Web Consortium Note 15 December 1997 Bryan Martin 1997 SGML and HTML Explained Addison Wesley Longman ISBN 0 201 40394 3 Retrieved 2010 08 18 Hossein Bidgoli 2004 The Internet encyclopedia Volume 3 John Wiley and Sons p 877 ISBN 0 471 22203 8 XML 1 0 slide Processing Instructions PIs www w3 org Retrieved 2023 02 08 Elliotte Rusty Harold W Scott Means 2004 XML in a nutshell p 23 ISBN 978 0 596 00764 5 Associating Style Sheets with XML documents 1 0 Second Edition Part 2 FO Processing Instruction Reference Robots Processing Instruction Homepage Archived from the original on 2010 09 21 Retrieved 2010 08 18 External links editXML specification section Processing Instructions XSLT FAQ Processing Instructions Dave Pawson xslt processing instruction Mozilla Retrieved from https en wikipedia org w index php title Processing Instruction amp oldid 1177819783, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.