
Static Public Member Functions | |
| static | contentFromXML ($input) |
| Decode content stored as XML. | |
| static | contentToXML ($input) |
| Encode content for storage as XML. | |
| static | formatXML ($xml, $highlight=false, $lineNumbers=false) |
| Formats XML, optionally adding syntax highlighting. | |
| static | parse ($xml, $intoDOM=false) |
| Parse an XML string and catch any parsing errors. | |
| static | validateXML ($xml, $useSchema=true) |
| Validates XML for well-formedness and against Shodor schema. | |
Static Protected Member Functions | |
| static | XMLParseErrorHandler2 ($errno, $errstr, $errfile, $errline) |
| Catches redirected XML parsing errors. | |
Definition at line 8 of file SXMLHelper.php5.
| static SXMLHelper::contentFromXML | ( | $ | input | ) | [static] |
Decode content stored as XML.
Replace all XML entity encodings with the characters they represent
| $input | [string]: An XML string |
Definition at line 168 of file SXMLHelper.php5.
| static SXMLHelper::contentToXML | ( | $ | input | ) | [static] |
Encode content for storage as XML.
Replace all XML illegal characters with the proper entity encodings
| $input | [string]: A string of content to be made safe for XML |
Definition at line 149 of file SXMLHelper.php5.
Referenced by FormInput::buildInput(), and FormInput::buildInstance().
| static SXMLHelper::formatXML | ( | $ | xml, | |
| $ | highlight = false, |
|||
| $ | lineNumbers = false | |||
| ) | [static] |
Formats XML, optionally adding syntax highlighting.
| $xml | [string]: XML to format |
Definition at line 124 of file SXMLHelper.php5.
References XmlFormatter::format().
Referenced by SnapContentInteractivateLesson::prepareAndValidateXML(), SnapContentInteractivateInstructor::prepareAndValidateXML(), SnapContentHtml::setHTML(), and SnapContentXml::setXML().
| static SXMLHelper::parse | ( | $ | xml, | |
| $ | intoDOM = false | |||
| ) | [static] |
Parse an XML string and catch any parsing errors.
Use this static function to help with XML parsing. All parse errors are caught and sent to SErrorManager.
| $xml | [string]: A string of XML |
Definition at line 18 of file SXMLHelper.php5.
Referenced by SObject::parseXML(), STransXML::translate(), STransStdXML3::translate(), STransStdXML::translate(), STransSDRMetadata::translate(), STransPhotoXML::translate(), STransNSDLSearchXML::translate(), STransNavXML::translate(), STransListXML::translate(), STransBookXML::translate(), and STransStdXML3Helper::translateListPage().
| static SXMLHelper::validateXML | ( | $ | xml, | |
| $ | useSchema = true | |||
| ) | [static] |
Validates XML for well-formedness and against Shodor schema.
Validation against Shodor schema is optional. If there is an error, an array of error information is returned. Each entry in the return array is an array containing four entries:
| $xml | [string]: String of XML to validate | |
| $useSchema | [boolean]: If true, validate XML against Shodor schema (default) |
Definition at line 76 of file SXMLHelper.php5.
Referenced by XmlFormatter::finalGenerateXML(), SnapContentLessonPlan::generateXML(), SnapContentLessonPlan::isKeyValid(), SnapContentInteractivateLesson::prepareAndValidateXML(), SnapContentInteractivateInstructor::prepareAndValidateXML(), SnapContentHtml::setHTML(), SnapContentLessonPlan::setOutlineField(), and SnapContentXml::setXML().
| static SXMLHelper::XMLParseErrorHandler2 | ( | $ | errno, | |
| $ | errstr, | |||
| $ | errfile, | |||
| $ | errline | |||
| ) | [static, protected] |
Catches redirected XML parsing errors.
For internal use only.
Errors are temporarily redirected to this function during XML parsing so that they can be reported to the output.
Definition at line 48 of file SXMLHelper.php5.
1.5.6