001package org.hl7.fhir.utilities.xhtml; 002 003/* 004 Copyright (c) 2011+, HL7, Inc. 005 All rights reserved. 006 007 Redistribution and use in source and binary forms, with or without modification, 008 are permitted provided that the following conditions are met: 009 010 * Redistributions of source code must retain the above copyright notice, this 011 list of conditions and the following disclaimer. 012 * Redistributions in binary form must reproduce the above copyright notice, 013 this list of conditions and the following disclaimer in the documentation 014 and/or other materials provided with the distribution. 015 * Neither the name of HL7 nor the names of its contributors may be used to 016 endorse or promote products derived from this software without specific 017 prior written permission. 018 019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 020 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 021 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 022 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 023 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 024 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 025 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 026 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 027 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 028 POSSIBILITY OF SUCH DAMAGE. 029 030 */ 031 032 033 034import java.io.IOException; 035 036import org.apache.commons.lang3.StringUtils; 037import org.hl7.fhir.exceptions.FHIRException; 038import org.hl7.fhir.utilities.xml.IXMLWriter; 039import org.hl7.fhir.utilities.xml.XMLUtil; 040import org.w3c.dom.Element; 041import org.w3c.dom.Node; 042 043public class CDANarrativeFormat { 044 045 /** 046 * for a CDA narrative, return the matching XHTML. 047 * 048 * For further information, see http://wiki.hl7.org/index.php?title=CDA_Narrative_to_html_mapping 049 * 050 * @param ed 051 * @return 052 * @throws FHIRException 053 */ 054 public XhtmlNode convert(Element ed) throws FHIRException { 055 XhtmlNode div = new XhtmlNode(NodeType.Element, "div"); 056 div.setAttribute("xmlns", XhtmlNode.XMLNS); 057 processAttributes(ed, div, "ID", "language", "styleCode"); 058 processChildren(ed, div); 059 return div; 060 } 061 062 private void processChildren(Element ed, XhtmlNode x) throws FHIRException { 063 for (Node n : XMLUtil.children(ed)) 064 processChildNode(n, x); 065 } 066 067 private void processChildNode(Node n, XhtmlNode xn) throws FHIRException { 068 switch (n.getNodeType()) { 069 case Node.ATTRIBUTE_NODE: 070 case Node.CDATA_SECTION_NODE: 071 case Node.DOCUMENT_FRAGMENT_NODE: 072 case Node.DOCUMENT_TYPE_NODE: 073 case Node.DOCUMENT_NODE: 074 case Node.ENTITY_NODE: 075 case Node.PROCESSING_INSTRUCTION_NODE: 076 case Node.NOTATION_NODE: 077 return; 078 case Node.ENTITY_REFERENCE_NODE: 079 throw new Error("Not handled yet"); 080 case Node.COMMENT_NODE: 081 xn.addComment(n.getTextContent()); 082 return; 083 case Node.TEXT_NODE: 084 if (!StringUtils.isWhitespace(n.getTextContent())) 085 xn.addText(n.getTextContent()); 086 return; 087 case Node.ELEMENT_NODE: 088 Element e = (Element) n; 089 if (n.getNodeName().equals("br")) { 090 processBreak(e, xn); 091 } else if (n.getNodeName().equals("caption")) { 092 processCaption(e, xn); 093 } else if (n.getNodeName().equals("col")) { 094 processCol(e, xn); 095 } else if (n.getNodeName().equals("colgroup")) { 096 processColGroup(e, xn); 097 } else if (n.getNodeName().equals("content")) { 098 processContent(e, xn); 099 } else if (n.getNodeName().equals("footnote")) { 100 processFootNote(e, xn); 101 } else if (n.getNodeName().equals("footnoteRef")) { 102 processFootNodeRef(e, xn); 103 } else if (n.getNodeName().equals("item")) { 104 processItem(e, xn); 105 } else if (n.getNodeName().equals("linkHtml") || n.getNodeName().equals("a")) { 106 processlinkHtml(e, xn); 107 } else if (n.getNodeName().equals("list")) { 108 processList(e, xn); 109 } else if (n.getNodeName().equals("paragraph")) { 110 processParagraph(e, xn); 111 } else if (n.getNodeName().equals("renderMultiMedia")) { 112 processRenderMultiMedia(e, xn); 113 } else if (n.getNodeName().equals("sub")) { 114 processSub(e, xn); 115 } else if (n.getNodeName().equals("sup")) { 116 processSup(e, xn); 117 } else if (n.getNodeName().equals("table")) { 118 processTable(e, xn); 119 } else if (n.getNodeName().equals("tbody")) { 120 processTBody(e, xn); 121 } else if (n.getNodeName().equals("td")) { 122 processTd(e, xn); 123 } else if (n.getNodeName().equals("tfoot")) { 124 processTFoot(e, xn); 125 } else if (n.getNodeName().equals("th")) { 126 processTh(e, xn); 127 } else if (n.getNodeName().equals("thead")) { 128 processTHead(e, xn); 129 } else if (n.getNodeName().equals("tr")) { 130 processTr(e, xn); 131 } else { 132 throw new FHIRException("Unknown element " + n.getNodeName()); 133 } 134 } 135 } 136 137 private void processBreak(Element e, XhtmlNode xn) { 138 xn.addTag("br"); 139 } 140 141 private void processCaption(Element e, XhtmlNode xn) throws FHIRException { 142 XhtmlNode xc = xn.addTag("caption"); 143 processAttributes(e, xc, "ID", "language", "styleCode"); 144 processChildren(e, xc); 145 } 146 147 private void processCol(Element e, XhtmlNode xn) throws FHIRException { 148 XhtmlNode xc = xn.addTag("col"); 149 processAttributes(e, xc, "ID", "language", "styleCode", "span", "width", "align", "char", "charoff", "valign"); 150 processChildren(e, xc); 151 } 152 153 private void processColGroup(Element e, XhtmlNode xn) throws FHIRException { 154 XhtmlNode xc = xn.addTag("colgroup"); 155 processAttributes(e, xc, "ID", "language", "styleCode", "span", "width", "align", "char", "charoff", "valign"); 156 processChildren(e, xc); 157 } 158 159 private void processContent(Element e, XhtmlNode xn) throws FHIRException { 160 XhtmlNode xc = xn.addTag("span"); 161 processAttributes(e, xc, "ID", "language", "styleCode"); 162 // todo: do something with revised..., "revised" 163 processChildren(e, xc); 164 } 165 166 private void processFootNote(Element e, XhtmlNode xn) { 167 XhtmlNode xc = xn.addTag("tfoot"); 168 processAttributes(e, xc, "ID", "language", "styleCode", "align", "char", "charoff", "valign"); 169 processChildren(e, xc); 170 } 171 172 private void processFootNodeRef(Element e, XhtmlNode xn) { 173 throw new Error("element "+e.getNodeName()+" not handled yet"); 174 } 175 176 private void processItem(Element e, XhtmlNode xn) throws FHIRException { 177 XhtmlNode xc = xn.addTag("li"); 178 processAttributes(e, xc, "ID", "language", "styleCode"); 179 processChildren(e, xc); 180 } 181 182 private void processlinkHtml(Element e, XhtmlNode xn) throws FHIRException { 183 XhtmlNode xc = xn.addTag("a"); 184 processAttributes(e, xc, "name", "href", "rel", "rev", "title", "ID", "language", "styleCode"); 185 processChildren(e, xc); 186 } 187 188 private void processList(Element e, XhtmlNode xn) throws FHIRException { 189 String lt = e.getAttribute("listType"); 190 XhtmlNode xc = xn.addTag("ordered".equals(lt) ? "ol" : "ul"); 191 processAttributes(e, xc, "ID", "language", "styleCode"); 192 processChildren(e, xc); 193 } 194 195 private void processParagraph(Element e, XhtmlNode xn) throws FHIRException { 196 XhtmlNode xc = xn.addTag("p"); 197 processAttributes(e, xc, "ID", "language", "styleCode"); 198 processChildren(e, xc); 199 } 200 201 private void processRenderMultiMedia(Element e, XhtmlNode xn) throws FHIRException { 202 XhtmlNode xc = xn.addTag("img"); 203 String v = e.getAttribute("referencedObject"); 204 xc.attribute("src", v); 205 processAttributes(e, xc, "ID", "language", "styleCode"); 206 processChildren(e, xc); 207 } 208 209 private void processSub(Element e, XhtmlNode xn) throws FHIRException { 210 XhtmlNode xc = xn.addTag("sub"); 211 processChildren(e, xc); 212 } 213 214 private void processSup(Element e, XhtmlNode xn) throws FHIRException { 215 XhtmlNode xc = xn.addTag("sup"); 216 processChildren(e, xc); 217 } 218 219 private void processTable(Element e, XhtmlNode xn) throws FHIRException { 220 XhtmlNode xc = xn.addTag("table"); 221 processAttributes(e, xc, "ID", "language", "styleCode", "summary", "width", "border", "frame", "rules", "cellspacing", "cellpadding"); 222 processChildren(e, xc); 223 } 224 225 private void processTBody(Element e, XhtmlNode xn) throws FHIRException { 226 XhtmlNode xc = xn.addTag("tbody"); 227 processAttributes(e, xc, "ID", "language", "styleCode", "align", "char", "charoff", "valign"); 228 processChildren(e, xc); 229 } 230 231 private void processTd(Element e, XhtmlNode xn) throws FHIRException { 232 XhtmlNode xc = xn.addTag("td"); 233 processAttributes(e, xc, "ID", "language", "styleCode", "abbr", "axis", "headers", "scope", "rowspan", "colspan", "align", "char", "charoff", "valign"); 234 processChildren(e, xc); 235 } 236 237 private void processTFoot(Element e, XhtmlNode xn) { 238 XhtmlNode xc = xn.addTag("tfoot"); 239 processAttributes(e, xc, "ID", "language", "styleCode", "align", "char", "charoff", "valign"); 240 processChildren(e, xc); 241 } 242 243 private void processTh(Element e, XhtmlNode xn) throws FHIRException { 244 XhtmlNode xc = xn.addTag("th"); 245 processAttributes(e, xc, "ID", "language", "styleCode", "abbr", "axis", "headers", "scope", "rowspan", "colspan", "align", "char", "charoff", "valign"); 246 processChildren(e, xc); 247 } 248 249 private void processTHead(Element e, XhtmlNode xn) throws FHIRException { 250 XhtmlNode xc = xn.addTag("thead"); 251 processAttributes(e, xc, "ID", "language", "styleCode", "align", "char", "charoff", "valign"); 252 processChildren(e, xc); 253 } 254 255 private void processTr(Element e, XhtmlNode xn) throws FHIRException { 256 XhtmlNode xc = xn.addTag("tr"); 257 processAttributes(e, xc, "ID", "language", "styleCode", "align", "char", "charoff", "valign"); 258 processChildren(e, xc); 259 } 260 261 private void processLinkHtml(Element e, XhtmlNode xn) throws FHIRException { 262 XhtmlNode xc = xn.addTag("linkHtml"); 263 processAttributes(e, xc, "ID", "language", "styleCode", "align", "char", "charoff", "valign"); 264 processChildren(e, xc); 265 } 266 267 private void processAttributes(Element element, XhtmlNode xn, String... names) { 268 for (String n : names) { 269 if (element.hasAttribute(n)) { 270 String v = element.getAttribute(n); 271 switch(n) { 272 case "ID": 273 xn.attribute("id", v); 274 break; 275 case "styleCode": 276 String style = v; 277 switch(v) { 278 // according Table 15.2 CSS rendering, The CDAtm book, Keith W. Boone 279 case "Bold": 280 style = "font-weight: bold"; 281 break; 282 case "Underline": 283 style = "text-decoration: underline"; 284 break; 285 case "Italics": 286 style = "font-style: italic"; 287 break; 288 case "Emphasis": 289 style = "font-weight: small-caps"; 290 break; 291 case "Lrule": 292 style = "border-left: 1px"; 293 break; 294 case "Rrule": 295 style = "border-right: 1px"; 296 break; 297 case "Toprule": 298 style = "border-top: 1px"; 299 break; 300 case "Botrule": 301 style = "border-bottom: 1px"; 302 break; 303 case "Arabic": 304 style = "list-style-type: decimal"; 305 break; 306 case "LittleRoman": 307 style = "list-style-type: lower-roman"; 308 break; 309 case "BigRoman": 310 style = "list-style-type: upper-roman"; 311 break; 312 case "LittleAlpha": 313 style = "list-style-type: lower-alpha"; 314 break; 315 case "BigAlpha": 316 style = "list-style-type: upper-alpha"; 317 break; 318 case "Disc": 319 style = "list-style-type: disc"; 320 break; 321 case "Circle": 322 style = "list-style-type: circle"; 323 break; 324 case "Square": 325 style = "list-style-type: square"; 326 break; 327 } 328 xn.attribute("style", style); 329 break; 330 default: 331 xn.attribute(n, v); 332 } 333 } 334 } 335 } 336 337 /** 338 * For XHTML return the matching CDA narrative. This is only guaranteed to work for XML produced from CDA, but will try whatever 339 * @param node 340 * @return 341 * @throws IOException 342 * @throws FHIRException 343 */ 344 public void convert(IXMLWriter xml, XhtmlNode div) throws IOException, FHIRException { 345 processAttributes(div, xml, "ID", "language", "styleCode"); 346 xml.enter("text"); 347 processChildren(xml, div); 348 xml.exit("text"); 349 } 350 351 private void processChildren(IXMLWriter xml, XhtmlNode x) throws IOException, FHIRException { 352 for (XhtmlNode n : x.getChildNodes()) 353 processChildNode(xml, n); 354 } 355 356 private void processChildNode(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { 357 switch (n.getNodeType()) { 358 case DocType: 359 case Document: 360 case Instruction: 361 return; 362 case Comment: 363 xml.comment(n.getContent(), true); 364 return; 365 case Text: 366 xml.text(n.getContent()); 367 return; 368 case Element: 369 if (n.getName().equals("br")) 370 processBreak(xml, n); 371 else if (n.getName().equals("h2") || n.getName().equals("caption")) 372 processCaption(xml, n); 373 else if (n.getName().equals("col")) 374 processCol(xml, n); 375 else if (n.getName().equals("colgroup")) 376 processColGroup(xml, n); 377 else if (n.getName().equals("span")) 378 processContent(xml, n); 379 else if (n.getName().equals("footnote")) 380 processFootNote(xml, n); 381 else if (n.getName().equals("footnoteRef")) 382 processFootNodeRef(xml, n); 383 else if (n.getName().equals("li")) 384 processItem(xml, n); 385 else if (n.getName().equals("linkHtml")) 386 processlinkHtml(xml, n); 387 else if (n.getName().equals("ul") || n.getName().equals("ol")) 388 processList(xml, n); 389 else if (n.getName().equals("p")) 390 processParagraph(xml, n); 391 else if (n.getName().equals("img")) 392 processRenderMultiMedia(xml, n); 393 else if (n.getName().equals("sub")) 394 processSub(xml, n); 395 else if (n.getName().equals("sup")) 396 processSup(xml, n); 397 else if (n.getName().equals("table")) 398 processTable(xml, n); 399 else if (n.getName().equals("tbody")) 400 processTBody(xml, n); 401 else if (n.getName().equals("td")) 402 processTd(xml, n); 403 else if (n.getName().equals("tfoot")) 404 processTFoot(xml, n); 405 else if (n.getName().equals("th")) 406 processTh(xml, n); 407 else if (n.getName().equals("thead")) 408 processTHead(xml, n); 409 else if (n.getName().equals("a")) 410 processA(xml, n); 411 else if (n.getName().equals("tr")) 412 processTr(xml, n); 413 else 414 throw new FHIRException("Unknown element "+n.getName()); 415 } 416 } 417 418 private void processBreak(IXMLWriter xml, XhtmlNode n) throws IOException { 419 xml.element("br"); 420 } 421 422 private void processCaption(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { 423 processAttributes(n, xml, "id", "language", "styleCode"); 424 xml.enter("caption"); 425 processChildren(xml, n); 426 xml.exit("caption"); 427 } 428 429 private void processCol(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { 430 processAttributes(n, xml, "id", "language", "styleCode", "span", "width", "align", "char", "charoff", "valign"); 431 xml.enter("col"); 432 processChildren(xml, n); 433 xml.exit("col"); 434 } 435 436 private void processColGroup(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { 437 processAttributes(n, xml, "id", "language", "styleCode", "span", "width", "align", "char", "charoff", "valign"); 438 xml.enter("colgroup"); 439 processChildren(xml, n); 440 xml.exit("colgroup"); 441 } 442 443 private void processContent(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { 444 processAttributes(n, xml, "id", "language", "styleCode"); 445 xml.enter("content"); 446 // todo: do something with revised..., "revised" 447 processChildren(xml, n); 448 xml.exit("content"); 449 } 450 451 private void processFootNote(IXMLWriter xml, XhtmlNode n) { 452 throw new Error("element "+n.getName()+" not handled yet"); 453 } 454 455 private void processFootNodeRef(IXMLWriter xml, XhtmlNode n) { 456 throw new Error("element "+n.getName()+" not handled yet"); 457 } 458 459 private void processItem(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { 460 processAttributes(n, xml, "id", "language", "styleCode"); 461 xml.enter("item"); 462 processChildren(xml, n); 463 xml.exit("item"); 464 } 465 466 private void processlinkHtml(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { 467 String v = n.getAttribute("src"); 468 xml.attribute("referencedObject", v); 469 processAttributes(n, xml, "name", "href", "rel", "rev", "title", "id", "language", "styleCode"); 470 xml.enter("linkHtml"); 471 processChildren(xml, n); 472 xml.exit("linkHtml"); 473 } 474 475 private void processList(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { 476 if (n.getName().equals("ol")) 477 xml.attribute("listType", "ordered"); 478 else 479 xml.attribute("listType", "unordered"); 480 processAttributes(n, xml, "id", "language", "styleCode"); 481 xml.enter("list"); 482 processChildren(xml, n); 483 xml.exit("list"); 484 } 485 486 private void processParagraph(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { 487 processAttributes(n, xml, "id", "language", "styleCode"); 488 xml.enter("paragraph"); 489 processChildren(xml, n); 490 xml.exit("paragraph"); 491 } 492 493 private void processRenderMultiMedia(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { 494 String v = n.getAttribute("src"); 495 xml.attribute("referencedObject", v); 496 processAttributes(n, xml, "id", "language", "styleCode"); 497 xml.enter("renderMultiMedia"); 498 processChildren(xml, n); 499 xml.exit("renderMultiMedia"); 500 } 501 502 private void processSub(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { 503 xml.enter("sub"); 504 processChildren(xml, n); 505 xml.exit("sub"); 506 } 507 508 private void processSup(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { 509 xml.enter("sup"); 510 processChildren(xml, n); 511 xml.exit("sup"); 512 } 513 514 private void processTable(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { 515 processAttributes(n, xml, "id", "language", "styleCode", "summary", "width", "border", "frame", "rules", "cellspacing", "cellpadding"); 516 xml.enter("table"); 517 processChildren(xml, n); 518 xml.exit("table"); 519 } 520 521 private void processTBody(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { 522 processAttributes(n, xml, "id", "language", "styleCode", "align", "char", "charoff", "valign"); 523 xml.enter("tbody"); 524 processChildren(xml, n); 525 xml.exit("tbody"); 526 } 527 528 private void processTd(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { 529 processAttributes(n, xml, "id", "language", "styleCode", "abbr", "axis", "headers", "scope", "rowspan", "colspan", "align", "char", "charoff", "valign"); 530 xml.enter("td"); 531 processChildren(xml, n); 532 xml.exit("td"); 533 } 534 535 private void processTFoot(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { 536 processAttributes(n, xml, "id", "language", "styleCode", "align", "char", "charoff", "valign"); 537 xml.enter("tfoot"); 538 processChildren(xml, n); 539 xml.exit("tfoot"); 540 } 541 542 private void processTh(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { 543 processAttributes(n, xml, "id", "language", "styleCode", "abbr", "axis", "headers", "scope", "rowspan", "colspan", "align", "char", "charoff", "valign"); 544 xml.enter("th"); 545 processChildren(xml, n); 546 xml.exit("th"); 547 } 548 549 private void processTHead(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { 550 processAttributes(n, xml, "id", "language", "styleCode", "align", "char", "charoff", "valign"); 551 xml.enter("thead"); 552 processChildren(xml, n); 553 xml.exit("thead"); 554 } 555 556 private void processTr(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { 557 processAttributes(n, xml, "id", "language", "styleCode", "align", "char", "charoff", "valign"); 558 xml.enter("tr"); 559 processChildren(xml, n); 560 xml.exit("tr"); 561 } 562 563 private void processA(IXMLWriter xml, XhtmlNode n) throws IOException, FHIRException { 564 processAttributes(n, xml, "id", "language", "styleCode", "align", "char", "charoff", "valign"); 565 xml.enter("linkHtml"); 566 processChildren(xml, n); 567 xml.exit("linkHtml"); 568 } 569 570 private void processAttributes(XhtmlNode xn, IXMLWriter xml, String... names) throws IOException { 571 for (String n : names) { 572 if (xn.hasAttribute(n)) { 573 String v = xn.getAttribute(n); 574 switch(n) { 575 case "id": 576 xml.attribute("ID", v); 577 break; 578 case "style": 579 String style = v; 580 switch(v) { 581 // according Table 15.2 CSS rendering, The CDAtm book, Keith W. Boone, will not cover everything, just reverse of processAttributes 582 case "font-weight: bold": 583 style = "Bold"; 584 break; 585 case "text-decoration: underline": 586 style = "Underline"; 587 break; 588 case "font-style: italic": 589 style = "Italics"; 590 break; 591 case "font-weight: small-caps": 592 style = "Emphasis"; 593 break; 594 case "border-left: 1px": 595 style = "Lrule"; 596 break; 597 case "border-right: 1px": 598 style = "Rrule"; 599 break; 600 case "border-top: 1px": 601 style = "Toprule"; 602 break; 603 case "border-bottom: 1px": 604 style = "Botrule"; 605 break; 606 case "List-style-type: decimal": 607 style = "Arabic"; 608 break; 609 case "list-style-type: lower-roman": 610 style = "LittleRoman"; 611 break; 612 case "list-style-type: upper-roman": 613 style = "BigRoman"; 614 break; 615 case "list-style-type: lower-alpha": 616 style = "LittleAlpha"; 617 break; 618 case "list-style-type: upper-alpha": 619 style = "BigAlpha"; 620 break; 621 case "list-style-type: disc": 622 style = "Disc"; 623 break; 624 case "list-style-type: circle": 625 style = "Circle"; 626 break; 627 case "list-style-type: square": 628 style = "Square"; 629 break; 630 } 631 xml.attribute("styleCode", style); 632 break; 633 default: 634 xml.attribute(n, v); 635 } 636 } 637 } 638 } 639 640 641}