#include "templates.h" /*---------------------------------------------------------------------- GetSchemaFromDocType: Returns the name of the schema corresponding to a doc type. ----------------------------------------------------------------------*/ char *GetSchemaFromDocType (DocumentType docType) { #ifdef TEMPLATES switch (docType) { case docAnnot : return "Annot"; case docBookmark : return "Topics"; case docSVG : return "SVG"; case docMath : return "MathML"; case docXml : return "XML"; default : return "HTML"; } #endif // TEMPLATES return "HTML"; } /*---------------------------------------------------------------------- Returns the value of a string attribute ----------------------------------------------------------------------*/ char *GetAttributeStringValue (Element el, int att) { #ifdef TEMPLATES AttributeType attType; attType.AttrSSchema = TtaGetElementType(el).ElSSchema; attType.AttrTypeNum = att; Attribute attribute = TtaGetAttribute(el, attType); int size = TtaGetTextAttributeLength(attribute); char *aux = (char*) TtaGetMemory(size+1); TtaGiveTextAttributeValue (attribute, aux, &size); return aux; #else return '\0'; #endif /* TEMPLATES */ } /*---------------------------------------------------------------------- Returns the value of a string attribute ----------------------------------------------------------------------*/ char *GetAttributeStringValue (Element el, Attribute attribute) { #ifdef TEMPLATES int size = TtaGetTextAttributeLength(attribute); char *aux = (char*) TtaGetMemory(size+1); TtaGiveTextAttributeValue (attribute, aux, &size); return aux; #else return '\0'; #endif /* TEMPLATES */ }