MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlBufDumpAttributeDecl

Function xmlBufDumpAttributeDecl

ThirdParty/libxml2/vtklibxml2/xmlsave.c:625–697  ·  view source on GitHub ↗

* xmlBufDumpAttributeDecl: * @buf: output buffer * @attr: An attribute declaration * * This will dump the content of the attribute declaration as an XML * DTD definition */

Source from the content-addressed store, hash-verified

623 * DTD definition
624 */
625static void
626xmlBufDumpAttributeDecl(xmlOutputBufferPtr buf, xmlAttributePtr attr) {
627 xmlOutputBufferWrite(buf, 10, "<!ATTLIST ");
628 xmlOutputBufferWriteString(buf, (const char *) attr->elem);
629 xmlOutputBufferWrite(buf, 1, " ");
630 if (attr->prefix != NULL) {
631 xmlOutputBufferWriteString(buf, (const char *) attr->prefix);
632 xmlOutputBufferWrite(buf, 1, ":");
633 }
634 xmlOutputBufferWriteString(buf, (const char *) attr->name);
635
636 switch (attr->atype) {
637 case XML_ATTRIBUTE_CDATA:
638 xmlOutputBufferWrite(buf, 6, " CDATA");
639 break;
640 case XML_ATTRIBUTE_ID:
641 xmlOutputBufferWrite(buf, 3, " ID");
642 break;
643 case XML_ATTRIBUTE_IDREF:
644 xmlOutputBufferWrite(buf, 6, " IDREF");
645 break;
646 case XML_ATTRIBUTE_IDREFS:
647 xmlOutputBufferWrite(buf, 7, " IDREFS");
648 break;
649 case XML_ATTRIBUTE_ENTITY:
650 xmlOutputBufferWrite(buf, 7, " ENTITY");
651 break;
652 case XML_ATTRIBUTE_ENTITIES:
653 xmlOutputBufferWrite(buf, 9, " ENTITIES");
654 break;
655 case XML_ATTRIBUTE_NMTOKEN:
656 xmlOutputBufferWrite(buf, 8, " NMTOKEN");
657 break;
658 case XML_ATTRIBUTE_NMTOKENS:
659 xmlOutputBufferWrite(buf, 9, " NMTOKENS");
660 break;
661 case XML_ATTRIBUTE_ENUMERATION:
662 xmlOutputBufferWrite(buf, 2, " (");
663 xmlBufDumpEnumeration(buf, attr->tree);
664 break;
665 case XML_ATTRIBUTE_NOTATION:
666 xmlOutputBufferWrite(buf, 11, " NOTATION (");
667 xmlBufDumpEnumeration(buf, attr->tree);
668 break;
669 default:
670 /* assert(0); */
671 break;
672 }
673
674 switch (attr->def) {
675 case XML_ATTRIBUTE_NONE:
676 break;
677 case XML_ATTRIBUTE_REQUIRED:
678 xmlOutputBufferWrite(buf, 10, " #REQUIRED");
679 break;
680 case XML_ATTRIBUTE_IMPLIED:
681 xmlOutputBufferWrite(buf, 9, " #IMPLIED");
682 break;

Callers 2

xhtmlNodeDumpOutputFunction · 0.85

Calls 4

xmlOutputBufferWriteFunction · 0.85
xmlBufDumpEnumerationFunction · 0.85

Tested by

no test coverage detected