예제 #1
0
def concat(xc, p, contextItem, args):
    if len(args) < 2: raise XPathContext.FunctionNumArgs()
    atomizedArgs = []
    for i in range(len(args)):
        item = anytypeArg(xc, args, i, "xs:anyAtomicType?")
        if item != ():
            atomizedArgs.append( FunctionXs.xsString( xc, p, xc.atomize(p, item) ) )
    return ''.join(atomizedArgs)
예제 #2
0
파일: FunctionFn.py 프로젝트: Arelle/Arelle
def string(xc, p, contextItem, args):
    if len(args) > 1: raise XPathContext.FunctionNumArgs()
    item = anytypeArg(xc, args, 0, "item()?", missingArgFallback=contextItem)
    if item == (): 
        return ''
    if isinstance(item, ModelObject) and getattr(item,"xValid", 0) == VALID_NO_CONTENT:
        x = item.stringValue # represents inner text of this and all subelements
    else:
        x = xc.atomize(p, item)
    return FunctionXs.xsString( xc, p, x ) 
예제 #3
0
def string(xc, p, contextItem, args):
    if len(args) > 1: raise XPathContext.FunctionNumArgs()
    x = atomicArg(xc,
                  p,
                  args,
                  0,
                  "item()?",
                  missingArgFallback=contextItem,
                  emptyFallback='')
    return FunctionXs.xsString(xc, p, x)
예제 #4
0
def string(xc, p, contextItem, args):
    if len(args) > 1: raise XPathContext.FunctionNumArgs()
    item = anytypeArg(xc, args, 0, "item()?", missingArgFallback=contextItem)
    if item == ():
        return ''
    if isinstance(item, ModelObject) and getattr(item, "xValid",
                                                 0) == VALID_NO_CONTENT:
        x = item.stringValue  # represents inner text of this and all subelements
    else:
        x = xc.atomize(p, item)
    return FunctionXs.xsString(xc, p, x)
예제 #5
0
def string(xc, p, contextItem, args):
    if len(args) > 1: raise XPathContext.FunctionNumArgs()
    x = atomicArg(xc, p, args, 0, "item()?", missingArgFallback=contextItem, emptyFallback='')
    return FunctionXs.xsString( xc, p, x )