/_zewdDocumentation1.m

http://github.com/robtweed/EWD · Objective C · 913 lines · 913 code · 0 blank · 0 comment · 23 complexity · 65881b68b6efe1122b1eed3eca2de6e6 MD5 · raw file

  1. %zewdDocumentation1 ;
  2. ;
  3. ; Product: Enterprise Web Developer (Build 910)
  4. ; Build Date: Wed, 25 Apr 2012 17:59:25
  5. ; ----------------------------------------------------------------------------
  6. ; | Enterprise Web Developer for GT.M and m_apache |
  7. ; | Copyright (c) 2004-12 M/Gateway Developments Ltd, |
  8. ; | Reigate, Surrey UK. |
  9. ; | All rights reserved. |
  10. ; | |
  11. ; | http://www.mgateway.com |
  12. ; | Email: rtweed@mgateway.com |
  13. ; | |
  14. ; | This program is free software: you can redistribute it and/or modify |
  15. ; | it under the terms of the GNU Affero General Public License as |
  16. ; | published by the Free Software Foundation, either version 3 of the |
  17. ; | License, or (at your option) any later version. |
  18. ; | |
  19. ; | This program is distributed in the hope that it will be useful, |
  20. ; | but WITHOUT ANY WARRANTY; without even the implied warranty of |
  21. ; | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
  22. ; | GNU Affero General Public License for more details. |
  23. ; | |
  24. ; | You should have received a copy of the GNU Affero General Public License |
  25. ; | along with this program. If not, see <http://www.gnu.org/licenses/>. |
  26. ; ----------------------------------------------------------------------------
  27. ;
  28. DOM1 ;
  29. ;;<ewdDocumentation api="DOM">
  30. ;;<method id="addElementToDOM">
  31. ;;<call>
  32. ;;s newOID=$$addElementToDOM^%zewdDOM(tagName,parentOID,"",.attrArray,text,asFirstChild)
  33. ;;</call>
  34. ;;<purpose>
  35. ;;Add an element, its associated attributes and text, if any, as a child of a parent element
  36. ;;</purpose>
  37. ;;<parameters>
  38. ;;<parameter no="1" name="tagName" mandatory="true">
  39. ;;The name of the new element to instantiate (NB case-sensitive)
  40. ;;</parameter>
  41. ;;<parameter no="2" name="parentOID" mandatory="true">
  42. ;;The OID of the new element's parent
  43. ;;</parameter>
  44. ;;<parameter no="3" name="null">
  45. ;;Not used: leave null
  46. ;;</parameter>
  47. ;;<parameter no="4" name="attrArray">
  48. ;;Local array containing attribute name/value pairs, in the format:
  49. ;;attrArray(attrName)=attrValue
  50. ;;For example:
  51. ;;attrArray("hello")="world"
  52. ;;attrArray("source")="c:\myFiles"
  53. ;;</parameter>
  54. ;;<parameter no="5" name="text">
  55. ;;Optional text to be added inside the element's opening and closing tags
  56. ;;</parameter>
  57. ;;<parameter no="6" name="asFirstChild">
  58. ;;By default, addElementToDoM adds the new element as the last child of the specified parent
  59. ;;element. If you set the asFirstChild parameter to "1", then the new element is added as
  60. ;;the first child of the parent node.
  61. ;;</parameter>
  62. ;;</parameters>
  63. ;;<returnValue>
  64. ;;The OID of the newly created Element, or an error string
  65. ;;</returnValue>
  66. ;;</method>
  67. ;;<method id="addTextToElement">
  68. ;;<call>
  69. ;;s textOID=$$addTextToElement^%zewdDOM(elementOID,text)
  70. ;;</call>
  71. ;;<purpose>
  72. ;;Adds/appends a text node to an element
  73. ;;</purpose>
  74. ;;<parameters>
  75. ;;<parameter no="1" name="elementOID" mandatory="true">
  76. ;;The OID of the element to which the text is to be added
  77. ;;</parameter>
  78. ;;<parameter no="2" name="text" mandatory="true">
  79. ;;The text to be added
  80. ;;</parameter>
  81. ;;</parameters>
  82. ;;<returnValue>
  83. ;;The OID of the newly created Text Node, or an error string
  84. ;;</returnValue>
  85. ;;</method>
  86. ;;<method id="appendChild">
  87. ;;<call>
  88. ;;s childOID=$$appendChild^%zewdDOM(newChildOID,parentOID)
  89. ;;</call>
  90. ;;<purpose>
  91. ;;Appends an element node as the last child of a parent element. The node
  92. ;;to be appended must exist within the DOM tree but must be currently
  93. ;;un-connected to any other node.
  94. ;;</purpose>
  95. ;;<parameters>
  96. ;;<parameter no="1" name="newChildOID" mandatory="true">
  97. ;;The OID of the element that is to be appended as a last child
  98. ;;</parameter>
  99. ;;<parameter no="2" name="parentOID" mandatory="true">
  100. ;;The OID of the parent element
  101. ;;</parameter>
  102. ;;</parameters>
  103. ;;<returnValue>
  104. ;;The OID of the newly created Child Node, or an error string
  105. ;;</returnValue>
  106. ;;</method>
  107. ;;<method id="attributeExists">
  108. ;;<call>
  109. ;;s exists=$$attributeExists^%zewdDOM(attributeName,elementOID)
  110. ;;</call>
  111. ;;<purpose>
  112. ;;Tests whether or not the specified element contains the specified attribute
  113. ;;</purpose>
  114. ;;<parameters>
  115. ;;<parameter no="1" name="attributeName" mandatory="true">
  116. ;;The name of the attribute
  117. ;;</parameter>
  118. ;;<parameter no="2" name="parentOID" mandatory="true">
  119. ;;The OID of the element
  120. ;;</parameter>
  121. ;;</parameters>
  122. ;;<returnValue>
  123. ;;Returns a value of 1 if the element contains the attribute; 0 if not
  124. ;;</returnValue>
  125. ;;</method>
  126. ;;<method id="clearDOMs">
  127. ;;<call>
  128. ;;d clearDOMs^%zewdDOM
  129. ;;</call>
  130. ;;<purpose>
  131. ;;Deletes all EWD DOMs from the current namespace.
  132. ;;</purpose>
  133. ;;<parameters />
  134. ;;<returnValue />
  135. ;;</method>
  136. ;;<method id="cloneDocument">
  137. ;;<call>
  138. ;;s toDocOID=$$cloneDocument^%zewdDOM(fromDocName,toDocName)
  139. ;;</call>
  140. ;;<purpose>
  141. ;;Creates an exact copy of a DOM
  142. ;;</purpose>
  143. ;;<parameters>
  144. ;;<parameter no="1" name="fromDocName" mandatory="true">
  145. ;;The name of the DOM to be copied
  146. ;;</parameter>
  147. ;;<parameter no="2" name="toDocName" mandatory="true">
  148. ;;The name of the DOM to be created
  149. ;;</parameter>
  150. ;;</parameters>
  151. ;;<returnValue>
  152. ;;The OID of the newly created DOM
  153. ;;</returnValue>
  154. ;;</method>
  155. ;;<method id="copyNodes">
  156. ;;<call>
  157. ;;s toNodeOID=$$copyNodes^%zewdDOM(fromNodeOID,toDocOID,parentOID,deep)
  158. ;;</call>
  159. ;;<purpose>
  160. ;;Copies a DOM node and, optionally the sub-tree underneath it, from one DOM to another. The
  161. ;;top copied node is appended as the last child of a specified parent element in the other DOM.
  162. ;;</purpose>
  163. ;;<parameters>
  164. ;;<parameter no="1" name="fromNodeOID" mandatory="true">
  165. ;;The node to be copied. If a sub-tree is being copied, specify the top node.
  166. ;;</parameter>
  167. ;;<parameter no="2" name="toDocOID" mandatory="true">
  168. ;;The OID of the DOM to which the node/subtree will be copied
  169. ;;</parameter>
  170. ;;<parameter no="3" name="parentOID" mandatory="true">
  171. ;;The OID of the element to which the node will be appended as the last child
  172. ;;</parameter>
  173. ;;<parameter no="4" name="deep" mandatory="true">
  174. ;;If a value of "true" is specified, then the entire sub-tree under the specified "fromNode" will be copied.
  175. ;;If any other value is specified, only the specified "fromNode" will be copied.
  176. ;;</parameter>
  177. ;;</parameters>
  178. ;;<returnValue>
  179. ;;The OID of the copied node within the DOM to which it has been copied.
  180. ;;</returnValue>
  181. ;;</method>
  182. ;;<method id="createCDATASection">
  183. ;;<call>
  184. ;;s cdataOID=$$createCDATASection^%zewdDOM(data,docOID)
  185. ;;</call>
  186. ;;<purpose>
  187. ;;Creates a CDATA Section node. The node will not be attached to any other node in the DOM
  188. ;;</purpose>
  189. ;;<parameters>
  190. ;;<parameter no="1" name="data" mandatory="true">
  191. ;;Text string containing the data to be included in the CDATA section. Any line breaks should
  192. ;;be specified using either $c(13,10) or $c(10)
  193. ;;</parameter>
  194. ;;<parameter no="2" name="docOID" mandatory="true">
  195. ;;The OID of the DOM into which the CDATA Section is to be added.
  196. ;;</parameter>
  197. ;;</parameters>
  198. ;;<returnValue>
  199. ;;The OID of the newly created CDATA Section node
  200. ;;</returnValue>
  201. ;;</method>
  202. ;;<method id="createComment">
  203. ;;<call>
  204. ;;s commentOID=$$createComment^%zewdDOM(data,docOID)
  205. ;;</call>
  206. ;;<purpose>
  207. ;;Creates a comment node. The node will not be attached to any other node in the DOM
  208. ;;</purpose>
  209. ;;<parameters>
  210. ;;<parameter no="1" name="data" mandatory="true">
  211. ;;Text string containing the comment. Any line breaks should
  212. ;;be specified using either $c(13,10) or $c(10)
  213. ;;</parameter>
  214. ;;<parameter no="2" name="docOID" mandatory="true">
  215. ;;The OID of the DOM into which the comment node is to be added.
  216. ;;</parameter>
  217. ;;</parameters>
  218. ;;<returnValue>
  219. ;;The OID of the newly created Comment node
  220. ;;</returnValue>
  221. ;;</method>
  222. ;;<method id="createDocumentType">
  223. ;;<call>
  224. ;;s docTypeOID=$$createDocumentType^%zewdDOM(qualifiedName,publicId,systemId,docOID)
  225. ;;</call>
  226. ;;<purpose>
  227. ;;Creates a Document Type node. The node will not be attached to any other node in the DOM
  228. ;;eg:
  229. ;;&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
  230. ;;
  231. ;;Here the qualifiedName = "html", the publicID = "-//W3C//DTD XHTML 1.0 Strict//EN" and
  232. ;;the systemId = "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
  233. ;;</purpose>
  234. ;;<parameters>
  235. ;;<parameter no="1" name="qualifiedName" mandatory="true">
  236. ;;The document type name, eg "html"
  237. ;;</parameter>
  238. ;;<parameter no="2" name="publicId">
  239. ;;The public ID of the document type, eg "-//W3C//DTD XHTML 1.0 Strict//EN". If specified, the word
  240. ;;"PUBLIC" will appear in the DOCTYPE tag.
  241. ;;</parameter>
  242. ;;<parameter no="3" name="systemId">
  243. ;;The system ID of the document type, eg "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd".
  244. ;;If a system ID is specified but no public ID is specified, the word "SYSTEM" will appear in the DOCTYPE tag.
  245. ;;</parameter>
  246. ;;<parameter no="4" name="docOID" mandatory="true">
  247. ;;The OID of the DOM into which the Document Type node is to be added.
  248. ;;</parameter>
  249. ;;</parameters>
  250. ;;<returnValue>
  251. ;;The OID of the newly created Document Type node
  252. ;;</returnValue>
  253. ;;</method>
  254. ;;
  255. ;;<method id="createElement">
  256. ;;<call>
  257. ;;s elementOID=$$createElement^%zewdDOM(tagName,docOID)
  258. ;;</call>
  259. ;;<purpose>
  260. ;;Creates an empty element node. The node will not be attached to any other node in the DOM
  261. ;;</purpose>
  262. ;;<parameters>
  263. ;;<parameter no="1" name="tagName" mandatory="true">
  264. ;;The element's tag name
  265. ;;</parameter>
  266. ;;<parameter no="2" name="docOID" mandatory="true">
  267. ;;The OID of the DOM into which the element node is to be added.
  268. ;;</parameter>
  269. ;;</parameters>
  270. ;;<returnValue>
  271. ;;The OID of the newly created Element node
  272. ;;</returnValue>
  273. ;;</method>
  274. ;;<method id="createProcessingInstruction">
  275. ;;<call>
  276. ;;s piOID=$$createProcessingInstruction^%zewdDOM(target,data,docOID)
  277. ;;</call>
  278. ;;<purpose>
  279. ;;Creates a processing instruction node. The node will not be attached to any other node in the DOM.
  280. ;;eg:
  281. ;;&lt;?xml version='1.0' encoding='UTF-8' ?&gt;
  282. ;;In this example, target = "xml", data = "version='1.0' encoding='UTF-8'
  283. ;;This method can also be used to create PHP processing instructions, eg:
  284. ;;&lt;?php
  285. ;;//this is some PHP code
  286. ;;?&gt;
  287. ;;In this example, "php" is the target and your PHP code is specified as data.
  288. ;;</purpose>
  289. ;;<parameters>
  290. ;;<parameter no="1" name="target" mandatory="true">
  291. ;;The Processing Instruction target
  292. ;;</parameter>
  293. ;;<parameter no="2" name="data" mandatory="true">
  294. ;;The data portion of the Processing Instruction
  295. ;;</parameter>
  296. ;;<parameter no="3" name="docOID" mandatory="true">
  297. ;;The OID of the DOM into which the processing instruction node is to be added.
  298. ;;</parameter>
  299. ;;</parameters>
  300. ;;<returnValue>
  301. ;;The OID of the newly created Processing Instruction node
  302. ;;</returnValue>
  303. ;;</method>
  304. ;;<method id="createTextNode">
  305. ;;<call>
  306. ;;s textOID=$$createTextNode^%zewdDOM(data,docOID)
  307. ;;</call>
  308. ;;<purpose>
  309. ;;Creates a text node. The node will not be attached to any other node in the DOM
  310. ;;</purpose>
  311. ;;<parameters>
  312. ;;<parameter no="1" name="data" mandatory="true">
  313. ;;Text string containing the text
  314. ;;</parameter>
  315. ;;<parameter no="2" name="docOID" mandatory="true">
  316. ;;The OID of the DOM into which the text node is to be added.
  317. ;;</parameter>
  318. ;;</parameters>
  319. ;;<returnValue>
  320. ;;The OID of the newly created Text node
  321. ;;</returnValue>
  322. ;;</method>
  323. ;;<method id="documentNameExists">
  324. ;;<call>
  325. ;;s exists=$$documentNameExists^%zewdDOM(docName)
  326. ;;</call>
  327. ;;<purpose>
  328. ;;Tests whether or not the specified DOM exists in the current namespace
  329. ;;</purpose>
  330. ;;<parameters>
  331. ;;<parameter no="1" name="docName" mandatory="true">
  332. ;;The name of the DOM document
  333. ;;</parameter>
  334. ;;</parameters>
  335. ;;<returnValue>
  336. ;;Returns a value of 1 if the named DOM exists; 0 if not
  337. ;;</returnValue>
  338. ;;</method>
  339. ;;<method id="getAttribute">
  340. ;;<call>
  341. ;;s attrValue=$$getAttribute^%zewdDOM(attrName,elementOID)
  342. ;;</call>
  343. ;;<purpose>
  344. ;;Returns the value of the specified attribute in the specified element
  345. ;;</purpose>
  346. ;;<parameters>
  347. ;;<parameter no="1" name="attrName" mandatory="true">
  348. ;;The name of the attribute
  349. ;;</parameter>
  350. ;;<parameter no="2" name="elementOID" mandatory="true">
  351. ;;The OID of the element
  352. ;;</parameter>
  353. ;;</parameters>
  354. ;;<returnValue>
  355. ;;The value of the specified attribute
  356. ;;</returnValue>
  357. ;;</method>
  358. ;;<method id="getAttributeArray">
  359. ;;<call>
  360. ;;s status=$$getAttributeArray^%zewdDOM(elementOID,.attrArray)
  361. ;;</call>
  362. ;;<purpose>
  363. ;;Returns a local array of attributes belonging to the specified element.
  364. ;;The array is of the format:
  365. ;;attrArray(attrName)=attrOID
  366. ;;eg:
  367. ;;attrArray("href")="7-107"
  368. ;;</purpose>
  369. ;;<parameters>
  370. ;;<parameter no="1" name="elementOID" mandatory="true">
  371. ;;The OID of the element
  372. ;;</parameter>
  373. ;;<parameter no="2" name="attrArray" mandatory="true">
  374. ;;The name of the array in which the list of attributes will be returned.
  375. ;;NB: called by reference
  376. ;;</parameter>
  377. ;;</parameters>
  378. ;;<returnValue>
  379. ;;Returns a value of null ("") if it ran successfully
  380. ;;</returnValue>
  381. ;;</method>
  382. ;;<method id="getAttributeValues">
  383. ;;<call>
  384. ;;d getAttributeValues^%zewdDOM(elementOID,.attrArray)
  385. ;;</call>
  386. ;;<purpose>
  387. ;;Returns a local array of attribute name/value pairs belonging to the specified element.
  388. ;;The array is of the format:
  389. ;;attrArray(attrName)=attrValue
  390. ;;eg:
  391. ;;attrArray("href")="http://www.mgateway.com"
  392. ;;</purpose>
  393. ;;<parameters>
  394. ;;<parameter no="1" name="elementOID" mandatory="true">
  395. ;;The OID of the element
  396. ;;</parameter>
  397. ;;<parameter no="2" name="attrArray" mandatory="true">
  398. ;;The name of the array in which the list of attributes will be returned.
  399. ;;NB: called by reference
  400. ;;</parameter>
  401. ;;</parameters>
  402. ;;<returnValue />
  403. ;;</method>
  404. ;;<method id="getChildrenInOrder">
  405. ;;<call>
  406. ;;d getChildrenInOrder^%zewdDOM(parentOID,.childArray)
  407. ;;</call>
  408. ;;<purpose>
  409. ;;Returns a local array of the OIDs of a node's child nodes, sorted in child position order
  410. ;;The array is of the format:
  411. ;;childArray(no)=childOID
  412. ;;eg:
  413. ;;childArray(1)="7-15"
  414. ;;</purpose>
  415. ;;<parameters>
  416. ;;<parameter no="1" name="parentOID" mandatory="true">
  417. ;;The OID of the parent element whose child elements you wish to locate
  418. ;;</parameter>
  419. ;;<parameter no="2" name="childArray" mandatory="true">
  420. ;;The name of the array in which the list of child nodes will be returned.
  421. ;;NB: called by reference
  422. ;;</parameter>
  423. ;;</parameters>
  424. ;;<returnValue />
  425. ;;</method>
  426. ;;<method id="getData">
  427. ;;<call>
  428. ;;s text=$$getData^%zewdDOM(nodeOID,.textArray)
  429. ;;</call>
  430. ;;<purpose>
  431. ;;Returns the data property for a node. This method is only applicable to those node types
  432. ;;that have a data property, eg 3 (text), 4 (CDATA), 7 (Processing Instruction), 8 (Comment)
  433. ;;
  434. ;;If the data content is under 15k, then it is returned as a single text string return value.
  435. ;;Longer content may be returned in the textArray
  436. ;;
  437. ;;The array is of the format:
  438. ;;textArray(lineNo)=line of data text
  439. ;;</purpose>
  440. ;;<parameters>
  441. ;;<parameter no="1" name="nodeOID" mandatory="true">
  442. ;;The OID of the node whose data is required
  443. ;;</parameter>
  444. ;;<parameter no="2" name="textArray" mandatory="true">
  445. ;;The name of the array in which text will be returned if too much to be returned as a simple return value.
  446. ;;NB: called by reference
  447. ;;</parameter>
  448. ;;</parameters>
  449. ;;<returnValue>
  450. ;;The data content of the node (if less than 15k in size)
  451. ;;</returnValue>
  452. ;;</method>
  453. ;;<method id="getDescendantNodes">
  454. ;;<call>
  455. ;;d getDescendantNodes^%zewdDOM(nodeOID,.OIDArray)
  456. ;;</call>
  457. ;;<purpose>
  458. ;;Returns a local array of the OIDs for all a node's descendant nodes (ie all nodes in the sub-tree beneath it)
  459. ;;The array is of the format:
  460. ;;OIDArray(nodeOID)=tagName | null if not an element
  461. ;;eg:
  462. ;;OIDArray("7-15")="div"
  463. ;;</purpose>
  464. ;;<parameters>
  465. ;;<parameter no="1" name="nodeOID" mandatory="true">
  466. ;;The OID of the parent element whose descendents you wish to locate
  467. ;;</parameter>
  468. ;;<parameter no="2" name="OIDArray" mandatory="true">
  469. ;;The name of the array in which the list of descendant nodes will be returned.
  470. ;;NB: called by reference
  471. ;;</parameter>
  472. ;;</parameters>
  473. ;;<returnValue />
  474. ;;</method>
  475. ;;<method id="getDocumentAttribute">
  476. ;;<call>
  477. ;;s attrib=$$getDocumentAttribute^%zewdDOM(docOID,attributeName)
  478. ;;</call>
  479. ;;<purpose>
  480. ;;Returns the value of the specified DOM document attribute.
  481. ;;</purpose>
  482. ;;<parameters>
  483. ;;<parameter no="1" name="docOID" mandatory="true">
  484. ;;The OID of the DOM
  485. ;;</parameter>
  486. ;;<parameter no="2" name="attributeName" mandatory="true">
  487. ;;The attribute required. The following are supported:
  488. ;;documentElement
  489. ;;documentName
  490. ;;creationDate
  491. ;;creationTime
  492. ;;</parameter>
  493. ;;</parameters>
  494. ;;<returnValue>
  495. ;;The value of the specified attribute
  496. ;;</returnValue>
  497. ;;</method>
  498. ;;<method id="getDocumentElement">
  499. ;;<call>
  500. ;;s deOID=$$getDocumentElement^%zewdDOM(docOID)
  501. ;;</call>
  502. ;;<purpose>
  503. ;;Returns the OID of a DOM's Document Element (ie its outermost element node)
  504. ;;</purpose>
  505. ;;<parameters>
  506. ;;<parameter no="1" name="docOID" mandatory="true">
  507. ;;The OID of the DOM
  508. ;;</parameter>
  509. ;;</parameters>
  510. ;;<returnValue>
  511. ;;The OID of the Document Element
  512. ;;</returnValue>
  513. ;;</method>
  514. ;;
  515. ;;<method id="getDocumentName">
  516. ;;<call>
  517. ;;s docName=$$getDocumentName^%zewdDOM(docOID)
  518. ;;</call>
  519. ;;<purpose>
  520. ;;Returns the Document Name of a specified DOM
  521. ;;</purpose>
  522. ;;<parameters>
  523. ;;<parameter no="1" name="docOID" mandatory="true">
  524. ;;The OID of the DOM
  525. ;;</parameter>
  526. ;;</parameters>
  527. ;;<returnValue>
  528. ;;The Document Name
  529. ;;</returnValue>
  530. ;;</method>
  531. ;;<method id="getDocumentNode">
  532. ;;<call>
  533. ;;s docOID=$$getDocumentNode^%zewdDOM(docName)
  534. ;;</call>
  535. ;;<purpose>
  536. ;;Returns the Document Node (ie the top-most DOM node) for a specified named DOM
  537. ;;</purpose>
  538. ;;<parameters>
  539. ;;<parameter no="1" name="docName" mandatory="true">
  540. ;;The DOcument Name of the DOM
  541. ;;</parameter>
  542. ;;</parameters>
  543. ;;<returnValue>
  544. ;;The OID of the Document Node
  545. ;;</returnValue>
  546. ;;</method>
  547. ;;<method id="getElementById">
  548. ;;<call>
  549. ;;s nodeOID=$$getElementById^%zewdDOM(id,docOID)
  550. ;;</call>
  551. ;;<purpose>
  552. ;;Returns the OID of the element that has the specified id attribute value
  553. ;;</purpose>
  554. ;;<parameters>
  555. ;;<parameter no="1" name="id" mandatory="true">
  556. ;;The id attribute value
  557. ;;</parameter>
  558. ;;<parameter no="2" name="docOID" mandatory="true">
  559. ;;The OID of the DOM
  560. ;;</parameter>
  561. ;;</parameters>
  562. ;;<returnValue>
  563. ;;The OID of the matching element
  564. ;;</returnValue>
  565. ;;</method>
  566. ;;<method id="getElementText">
  567. ;;<call>
  568. ;;s text=$$getElementText^%zewdDOM(nodeOID,.textArray)
  569. ;;</call>
  570. ;;<purpose>
  571. ;;Returns the text inside an element node, if it exists
  572. ;;
  573. ;;If the text is less than 15k, then it is returned as a single text string return value.
  574. ;;Longer content may be returned in the textArray
  575. ;;
  576. ;;The array is of the format:
  577. ;;textArray(lineNo)=line of data text
  578. ;;</purpose>
  579. ;;<parameters>
  580. ;;<parameter no="1" name="nodeOID" mandatory="true">
  581. ;;The OID of the node whose text is required
  582. ;;</parameter>
  583. ;;<parameter no="2" name="textArray" mandatory="true">
  584. ;;The name of the array in which text will be returned if too much to be returned as a simple return value.
  585. ;;NB: called by reference
  586. ;;</parameter>
  587. ;;</parameters>
  588. ;;<returnValue>
  589. ;;The text content of the element (if less than 15k in size)
  590. ;;</returnValue>
  591. ;;</method>
  592. ;;
  593. ;;<method id="getElementsArrayByTagName">
  594. ;;<call>
  595. ;;s status=$$getElementsArrayByTagName^%zewdDOM(tagName,docName,fromNodeOID,.OIDArray)
  596. ;;</call>
  597. ;;<purpose>
  598. ;;Returns a local array of all element nodes with the specified tag name.
  599. ;;The array is of the format:
  600. ;;OIDArray(nodeOID)=""
  601. ;;</purpose>
  602. ;;<parameters>
  603. ;;<parameter no="1" name="tagname" mandatory="true">
  604. ;;The name of the tag required, eg "div"
  605. ;;</parameter>
  606. ;;<parameter no="2" name="docName">
  607. ;;The Document Name of the DOM being searched. Specify this parameter if you want to search the entire DOM.
  608. ;;Leave blank if you want to search a sub-tree within the DOM
  609. ;;</parameter>
  610. ;;<parameter no="3" name="fromNodeOID">
  611. ;;The OID of the node at the top of the sub-tree you wish to search.
  612. ;;Specify this parameter if you want to search a sub-tree within the DOM.
  613. ;;Leave blank if you want to search the entire DOM.
  614. ;;</parameter>
  615. ;;<parameter no="4" name="OIDArray" mandatory="true">
  616. ;;The name of the array in which the list of matching elements will be returned.
  617. ;;NB: called by reference
  618. ;;</parameter>
  619. ;;</parameters>
  620. ;;<returnValue>
  621. ;;Returns the value "1~OIDArray" if successful
  622. ;;</returnValue>
  623. ;;</method>
  624. ;;
  625. ;;<method id="getFirstChild">
  626. ;;<call>
  627. ;;s childOID=$$getFirstChild^%zewdDOM(nodeOID)
  628. ;;</call>
  629. ;;<purpose>
  630. ;;Returns the OID of an element's first child node
  631. ;;</purpose>
  632. ;;<parameters>
  633. ;;<parameter no="1" name="nodeOID" mandatory="true">
  634. ;;The OID of the parent node
  635. ;;</parameter>
  636. ;;</parameters>
  637. ;;<returnValue>
  638. ;;The OID of the first child node. Returns null if the specified node has no child nodes
  639. ;;</returnValue>
  640. ;;</method>
  641. ;;<method id="getLastChild">
  642. ;;<call>
  643. ;;s childOID=$$getLastChild^%zewdDOM(nodeOID)
  644. ;;</call>
  645. ;;<purpose>
  646. ;;Returns the OID of an element's last child node
  647. ;;</purpose>
  648. ;;<parameters>
  649. ;;<parameter no="1" name="nodeOID" mandatory="true">
  650. ;;The OID of the parent node
  651. ;;</parameter>
  652. ;;</parameters>
  653. ;;<returnValue>
  654. ;;The OID of the last child node. Returns null if the specified node has no child nodes
  655. ;;</returnValue>
  656. ;;</method>
  657. ;;<method id="getListOfDOMs">
  658. ;;<call>
  659. ;;d getListOfDOMs^%zewdDOM(.domList)
  660. ;;</call>
  661. ;;<purpose>
  662. ;;Returns a local array of the EWD DOMs by Document Name in the current namespace
  663. ;;
  664. ;;The array is of the format:
  665. ;;domList(docName)=""
  666. ;;</purpose>
  667. ;;<parameters>
  668. ;;<parameter no="1" name="domList" mandatory="true">
  669. ;;The name of the array in which the DOM Document Names will be returned
  670. ;;NB: called by reference
  671. ;;</parameter>
  672. ;;</parameters>
  673. ;;<returnValue />
  674. ;;</method>
  675. ;;<method id="getLocalName">
  676. ;;<call>
  677. ;;s localName=$$getLocalName^%zewdDOM(nodeOID)
  678. ;;</call>
  679. ;;<purpose>
  680. ;;Returns the local name of a specified element. In the case of a tag name such as "ewd:config", then
  681. ;;the local name is "config". If the tag name does not contain a ":" character, then the tag name is
  682. ;;returned
  683. ;;</purpose>
  684. ;;<parameters>
  685. ;;<parameter no="1" name="nodeOID" mandatory="true">
  686. ;;The OID of the node
  687. ;;</parameter>
  688. ;;</parameters>
  689. ;;<returnValue>
  690. ;;The tag Local Name
  691. ;;</returnValue>
  692. ;;</method>
  693. ;;<method id="getName">
  694. ;;<call>
  695. ;;s attrName=$$getName^%zewdDOM(attrOID)
  696. ;;</call>
  697. ;;<purpose>
  698. ;;Returns the name of the specified attribute node
  699. ;;</purpose>
  700. ;;<parameters>
  701. ;;<parameter no="1" name="attrOID" mandatory="true">
  702. ;;The OID of the attribute node
  703. ;;</parameter>
  704. ;;</parameters>
  705. ;;<returnValue>
  706. ;;The attribute name
  707. ;;</returnValue>
  708. ;;</method>
  709. ;;<method id="getNextChild">
  710. ;;<call>
  711. ;;s nextChildOID=$$getNextChild^%zewdDOM(parentOID,childOID)
  712. ;;</call>
  713. ;;<purpose>
  714. ;;Returns the OID of the next sibling node after the one specified for a parent node. This method
  715. ;;can be called repeatedly to iterate through a node's child nodes.
  716. ;;</purpose>
  717. ;;<parameters>
  718. ;;<parameter no="1" name="parentOID" mandatory="true">
  719. ;;The OID of the parent node whose child nodes you wish to access
  720. ;;</parameter>
  721. ;;<parameter no="2" name="childOID" mandatory="true">
  722. ;;The OID of the previous child node. If this is set to null, the parent's first child is returned.
  723. ;;If the parent node's last child is specified, the method returns null.
  724. ;;</parameter>
  725. ;;</parameters>
  726. ;;<returnValue>
  727. ;;The OID of the next child node. Returns null if there are no more children.
  728. ;;</returnValue>
  729. ;;</method>
  730. ;;<method id="getNextSibling">
  731. ;;<call>
  732. ;;s siblingOID=$$getNextSibling^%zewdDOM(nodeOID)
  733. ;;</call>
  734. ;;<purpose>
  735. ;;Returns the OID of an element's next sibling node
  736. ;;</purpose>
  737. ;;<parameters>
  738. ;;<parameter no="1" name="nodeOID" mandatory="true">
  739. ;;The OID of the previous sibling node
  740. ;;</parameter>
  741. ;;</parameters>
  742. ;;<returnValue>
  743. ;;The OID of the next sibling node. Returns null if the specified node has no sibling nodes
  744. ;;</returnValue>
  745. ;;</method>
  746. ;;<method id="getNodeType">
  747. ;;<call>
  748. ;;s nodeType=$$getNodeType^%zewdDOM(nodeOID)
  749. ;;</call>
  750. ;;<purpose>
  751. ;;Returns the XML node type of the specified node. Supported node types are as follows:
  752. ;;1 = Element
  753. ;;2 = Attribute
  754. ;;3 = Text
  755. ;;4 = CDATA Section
  756. ;;7 = Processing Instruction
  757. ;;8 = Comment
  758. ;;10 = Document Type
  759. ;;</purpose>
  760. ;;<parameters>
  761. ;;<parameter no="1" name="nodeOID" mandatory="true">
  762. ;;The OID of the node
  763. ;;</parameter>
  764. ;;</parameters>
  765. ;;<returnValue>
  766. ;;The Node Type
  767. ;;</returnValue>
  768. ;;</method>
  769. ;;<method id="getOwnerElement">
  770. ;;<call>
  771. ;;s elementOID=$$getOwnerElement(attrOID)
  772. ;;</call>
  773. ;;<purpose>
  774. ;;Returns the OID of the element node that contains the specified attribute node
  775. ;;</purpose>
  776. ;;<parameters>
  777. ;;<parameter no="1" name="attrOID" mandatory="true">
  778. ;;The OID of the attribute node
  779. ;;</parameter>
  780. ;;</parameters>
  781. ;;<returnValue>
  782. ;;The OID of the owner element node
  783. ;;</returnValue>
  784. ;;</method>
  785. ;;<method id="getParentNode">
  786. ;;<call>
  787. ;;s parentOID=$$getParentNode^%zewdDOM(nodeOID)
  788. ;;</call>
  789. ;;<purpose>
  790. ;;Returns the OID of a node's parent node
  791. ;;</purpose>
  792. ;;<parameters>
  793. ;;<parameter no="1" name="nodeOID" mandatory="true">
  794. ;;The OID of the child node
  795. ;;</parameter>
  796. ;;</parameters>
  797. ;;<returnValue>
  798. ;;The OID of the parent node.
  799. ;;</returnValue>
  800. ;;</method>
  801. ;;<method id="getPrefix">
  802. ;;<call>
  803. ;;s prefix=$$getPrefix^%zewdDOM(nodeOID)
  804. ;;</call>
  805. ;;<purpose>
  806. ;;Returns the prefix of a specified element. In the case of a tag name such as "ewd:config", then
  807. ;;the prefix is "ewd". If the tag name does not contain a ":" character, then the tag name is
  808. ;;returned
  809. ;;</purpose>
  810. ;;<parameters>
  811. ;;<parameter no="1" name="nodeOID" mandatory="true">
  812. ;;The OID of the node
  813. ;;</parameter>
  814. ;;</parameters>
  815. ;;<returnValue>
  816. ;;The tag Prefix
  817. ;;</returnValue>
  818. ;;</method>
  819. ;;<method id="getPreviousSibling">
  820. ;;<call>
  821. ;;s siblingOID=$$getPreviousSibling^%zewdDOM(nodeOID)
  822. ;;</call>
  823. ;;<purpose>
  824. ;;Returns the OID of an element's previous sibling node
  825. ;;</purpose>
  826. ;;<parameters>
  827. ;;<parameter no="1" name="nodeOID" mandatory="true">
  828. ;;The OID of the next sibling node
  829. ;;</parameter>
  830. ;;</parameters>
  831. ;;<returnValue>
  832. ;;The OID of the previous sibling node. Returns null if the specified node has no previous sibling node
  833. ;;</returnValue>
  834. ;;</method>
  835. ;;<method id="getPublicId">
  836. ;;<call>
  837. ;;s publicId=$$getPublicId^%zewdDOM(nodeOID)
  838. ;;</call>
  839. ;;<purpose>
  840. ;;Returns the Public ID of a Document Type (DOCTYPE) element
  841. ;;</purpose>
  842. ;;<parameters>
  843. ;;<parameter no="1" name="nodeOID" mandatory="true">
  844. ;;The OID of the Document Type node
  845. ;;</parameter>
  846. ;;</parameters>
  847. ;;<returnValue>
  848. ;;The Public ID
  849. ;;</returnValue>
  850. ;;</method>
  851. ;;<method id="getSystemId">
  852. ;;<call>
  853. ;;s systemId=$$getSystemId^%zewdDOM(nodeOID)
  854. ;;</call>
  855. ;;<purpose>
  856. ;;Returns the System ID of a Document Type (DOCTYPE) element
  857. ;;</purpose>
  858. ;;<parameters>
  859. ;;<parameter no="1" name="nodeOID" mandatory="true">
  860. ;;The OID of the Document Type node
  861. ;;</parameter>
  862. ;;</parameters>
  863. ;;<returnValue>
  864. ;;The System ID
  865. ;;</returnValue>
  866. ;;</method>
  867. ;;<method id="getTagByNameAndAttr">
  868. ;;<call>
  869. ;;s nodeOID=$$getTagByNameAndAttr^%zewdDOM(tagName,attrName,attrValue,matchCase,docName)
  870. ;;</call>
  871. ;;<purpose>
  872. ;;Locates a node in the DOM that matches by tag name and a specified attribute value. For example you
  873. ;;could use this method to locate an &lt;a&gt; tag with an href attribute with a value of "page1.ewd"
  874. ;;</purpose>
  875. ;;<parameters>
  876. ;;<parameter no="1" name="tagName" mandatory="true">
  877. ;;The tag name required
  878. ;;</parameter>
  879. ;;<parameter no="2" name="attrName" mandatory="true">
  880. ;;The name of the attribute required
  881. ;;</parameter>
  882. ;;<parameter no="3" name="attrValue" mandatory="true">
  883. ;;The value of the required attribute
  884. ;;</parameter>
  885. ;;<parameter no="4" name="matchCase">
  886. ;;If set to 1, then the matching by attribute value is case-sensitive.
  887. ;;Default value is 0 (case-insensitive value match)
  888. ;;</parameter>
  889. ;;<parameter no="5" name="docName" mandatory="true">
  890. ;;The Document Name of the DOM being searched
  891. ;;</parameter>
  892. ;;</parameters>
  893. ;;<returnValue>
  894. ;;The OID of the matching Element node.
  895. ;;</returnValue>
  896. ;;</method>
  897. ;;<method id="getTagName">
  898. ;;<call>
  899. ;;s tagName=$$getTagName^%zewdDOM(nodeOID)
  900. ;;</call>
  901. ;;<purpose>
  902. ;;Returns the Tag Name of the specified Element Node
  903. ;;</purpose>
  904. ;;<parameters>
  905. ;;<parameter no="1" name="nodeOID" mandatory="true">
  906. ;;The OID of the element node
  907. ;;</parameter>
  908. ;;</parameters>
  909. ;;<returnValue>
  910. ;;The Element's Tag Name
  911. ;;</returnValue>
  912. ;;</method>
  913. ;;***END***