版博士V2.0程序
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 

55 rindas
1.5 KiB

  1. import IDocument from '../nodes/document/IDocument';
  2. import IDocumentFragment from '../nodes/document-fragment/IDocumentFragment';
  3. /**
  4. * XML parser.
  5. */
  6. export default class XMLParser {
  7. /**
  8. * Parses XML/HTML and returns a root element.
  9. *
  10. * @param document Document.
  11. * @param data HTML data.
  12. * @param [evaluateScripts = false] Set to "true" to enable script execution.
  13. * @returns Root element.
  14. */
  15. static parse(document: IDocument, data: string, evaluateScripts?: boolean): IDocumentFragment;
  16. /**
  17. * Returns a tag name if element is unnestable.
  18. *
  19. * @param element Element.
  20. * @returns Tag name if element is unnestable.
  21. */
  22. private static getUnnestableTagName;
  23. /**
  24. * Appends text and comment nodes.
  25. *
  26. * @param document Document.
  27. * @param node Node.
  28. * @param text Text to search in.
  29. */
  30. private static appendTextAndCommentNodes;
  31. /**
  32. * Returns text and comment nodes from a text.
  33. *
  34. * @param document Document.
  35. * @param text Text to search in.
  36. * @returns Nodes.
  37. */
  38. private static getTextAndCommentNodes;
  39. /**
  40. * Sets raw attributes.
  41. *
  42. * @param element Element.
  43. * @param attributesString Raw attributes.
  44. */
  45. private static setAttributes;
  46. /**
  47. * Returns attribute name.
  48. *
  49. * @param namespaceURI Namespace URI.
  50. * @param name Name.
  51. * @returns Attribute name based on namespace.
  52. */
  53. private static _getAttributeName;
  54. }