4Suite™ API Documentation

# ► Module Ft.Server.Common.DocumentReference

An intelligent reference to a document within or external to the repo
Copyright 2004 Fourthought, Inc. (USA).
Detailed license and copyright information: http://4suite.org/COPYRIGHT
Project home, documentation, distributions: http://4suite.org/

Classes: DocumentReference, DocumentReferenceType, ExternalDocumentReference, InternalDocumentReference, StringDocumentReference |  |  |  | Fields: BASIC_RESOLVER, FTSERVER_NAMESPACE, FTSS_URI_SCHEME, NonvalidatingReader

## Classes

class DocumentReference
Abstract base class for the various types of Document References

### Methods

__init__(self, rType)
toDom(self, baseObject)
Overidden by subclasses for implementation to convert the reference to a DOM node
toSchematron(self, baseObject)
Overidden by subclasses for implementation to convert the reference to a schematron instance
toStylesheet(self, baseObject)
Overidden by subclasses for implementation to convert the reference to a stylesheet

class DocumentReferenceType

### Fields

EXTERNAL = 2
INTERNAL = 1
STRING = 3

class ExternalDocumentReference(DocumentReference)
Reference to an external (non-repo) resource.

### Methods

__init__(self, uri)
toDom(self, baseObject)
Attempts to parse the external resource as XML, returning a Domlette document node. Parsing is done with the standard (repo-unaware) non-validating reader.
toSchematron(self, baseObject)
Attempts to parse the external resource as XML, returning a stylesheet document node. Parsing is done with the standard (repo-unaware) stylesheet reader. The stylesheet represents the result of applying Rick Jelliffe's Schematron preprocessor to the source document, resulting in a new stylesheet that can be used for validation.
toStylesheet(self, baseObject)
Attempts to parse the external resource as XML, returning a stylesheet document node. Parsing is done with the standard (repo-unaware) stylesheet reader. Assumes the resource really is XSLT.

class InternalDocumentReference(DocumentReference)
Reference to an internal resource

### Methods

__init__(self, uri)
toDom(self, baseObject)
toSchematron(self, baseObject)
toStylesheet(self, baseObject)

class StringDocumentReference(DocumentReference)
Reference to a string array

### Methods

__init__(self, data, baseUri)
toDom(self, baseObject)
toSchematron(self, baseObject)
toStylesheet(self, baseObject)

## Fields

BASIC_RESOLVER = <Ft.Lib.Uri.FtUriResolver instance>
FTSERVER_NAMESPACE = 'http://xmlns.4suite.org/reserved'
FTSS_URI_SCHEME = 'ftss'
NonvalidatingReader = <Ft.Xml.Domlette.NonvalidatingReaderBase instance>
The default non-validating reader instance, created from NonvalidatingReaderBase() with no constructor arguments.
Uses the default InputSource factory. If you need to change it,
reassign the inputSourceFactory attribute, or, preferably, just
create a new NonvalidatingReaderBase instance.