parameters: (tagStr, xml)
return_statement: return openTag, closeTag
docstring: Internal helper to construct opening and closing tag expressions, given a tag name
docstring_summary: Internal helper to construct opening and closing tag expressions, given a tag name
docstring_tokens: Internal helper to construct opening and closing tag expressions given a tag name
function: def _makeTags(tagStr, xml):
      """Internal helper to construct opening and closing tag expressions, given a tag name"""
      if isinstance(tagStr,basestring):
          resname = tagStr
          tagStr = Keyword(tagStr, caseless=not xml)
      else:
          resname = tagStr.name
  
      tagAttrName = Word(alphas,alphanums+"_-:")
      if (xml):
          tagAttrValue = dblQuotedString.copy().setParseAction( removeQuotes )
          openTag = Suppress("<") + tagStr("tag") + \
                  Dict(ZeroOrMore(Group( tagAttrName + Suppress("=") + tagAttrValue ))) + \
                  Optional("/",default=[False]).setResultsName("empty").setParseAction(lambda s,l,t:t[0]=='/') + Suppress(">")
      else:
          printablesLessRAbrack = "".join(c for c in printables if c not in ">")
          tagAttrValue = quotedString.copy().setParseAction( removeQuotes ) | Word(printablesLessRAbrack)
          openTag = Suppress("<") + tagStr("tag") + \
                  Dict(ZeroOrMore(Group( tagAttrName.setParseAction(downcaseTokens) + \
                  Optional( Suppress("=") + tagAttrValue ) ))) + \
                  Optional("/",default=[False]).setResultsName("empty").setParseAction(lambda s,l,t:t[0]=='/') + Suppress(">")
      closeTag = Combine(_L("</") + tagStr + ">")
  
      openTag = openTag.setResultsName("start"+"".join(resname.replace(":"," ").title().split())).setName("<%s>" % resname)
      closeTag = closeTag.setResultsName("end"+"".join(resname.replace(":"," ").title().split())).setName("</%s>" % resname)
      openTag.tag = resname
      closeTag.tag = resname
      return openTag, closeTag
function_tokens: def _makeTags ( tagStr , xml ) : if isinstance ( tagStr , basestring ) : resname = tagStr tagStr = Keyword ( tagStr , caseless = not xml ) else : resname = tagStr . name tagAttrName = Word ( alphas , alphanums + "_-:" ) if ( xml ) : tagAttrValue = dblQuotedString . copy ( ) . setParseAction ( removeQuotes ) openTag = Suppress ( "<" ) + tagStr ( "tag" ) + Dict ( ZeroOrMore ( Group ( tagAttrName + Suppress ( "=" ) + tagAttrValue ) ) ) + Optional ( "/" , default = [ False ] ) . setResultsName ( "empty" ) . setParseAction ( lambda s , l , t : t [ 0 ] == '/' ) + Suppress ( ">" ) else : printablesLessRAbrack = "" . join ( c for c in printables if c not in ">" ) tagAttrValue = quotedString . copy ( ) . setParseAction ( removeQuotes ) | Word ( printablesLessRAbrack ) openTag = Suppress ( "<" ) + tagStr ( "tag" ) + Dict ( ZeroOrMore ( Group ( tagAttrName . setParseAction ( downcaseTokens ) + Optional ( Suppress ( "=" ) + tagAttrValue ) ) ) ) + Optional ( "/" , default = [ False ] ) . setResultsName ( "empty" ) . setParseAction ( lambda s , l , t : t [ 0 ] == '/' ) + Suppress ( ">" ) closeTag = Combine ( _L ( "</" ) + tagStr + ">" ) openTag = openTag . setResultsName ( "start" + "" . join ( resname . replace ( ":" , " " ) . title ( ) . split ( ) ) ) . setName ( "<%s>" % resname ) closeTag = closeTag . setResultsName ( "end" + "" . join ( resname . replace ( ":" , " " ) . title ( ) . split ( ) ) ) . setName ( "</%s>" % resname ) openTag . tag = resname closeTag . tag = resname return openTag , closeTag