xsd
Ce contenu n’est pas encore disponible dans votre langue.
Functions and types to parse XML schema definitions (ie. .xsd files).
Classes
ChildProps
Constructors
new ChildProps()
new ChildProps(params): ChildPropsParameters
• params
• params.maxOccurs?: number
• params.minOccurs?: number
• params.type: string
Returns
Defined in
tmp/commons/src/lib/utils/xsd.ts:46
Properties
maxOccurs?
optional maxOccurs: number;Defined in
tmp/commons/src/lib/utils/xsd.ts:44
minOccurs?
optional minOccurs: number;Defined in
tmp/commons/src/lib/utils/xsd.ts:43
type
type: string;Defined in
tmp/commons/src/lib/utils/xsd.ts:42
Accessors
required
get required(): booleanReturns
boolean
Defined in
tmp/commons/src/lib/utils/xsd.ts:56
unique
get unique(): booleanReturns
boolean
Defined in
tmp/commons/src/lib/utils/xsd.ts:52
Methods
toJSON()
toJSON(): objectReturns
object
maxOccurs
maxOccurs: undefined | number;minOccurs
minOccurs: undefined | number;type
type: string;Defined in
tmp/commons/src/lib/utils/xsd.ts:64
fromObject()
static fromObject(obj): ChildPropsParameters
• obj
• obj.maxOccurs: undefined | number = ...
• obj.minOccurs: undefined | number = ...
• obj.type: string = ...
Returns
Defined in
tmp/commons/src/lib/utils/xsd.ts:60
ComplexType
A complex type in an XML schema definition.
Constructors
new ComplexType()
new ComplexType(params): ComplexTypeParameters
• params
• params.attributes?: Attribute[]
• params.children?: ChildProps[]
• params.doc?: string
• params.name: string
Returns
Defined in
tmp/commons/src/lib/utils/xsd.ts:87
Properties
attributes
attributes: Map<string, Attribute>;Defined in
tmp/commons/src/lib/utils/xsd.ts:84
children
children: ChildProps[];Defined in
tmp/commons/src/lib/utils/xsd.ts:85
doc?
optional doc: string;Documentation of the complex type.
Defined in
tmp/commons/src/lib/utils/xsd.ts:79
name
name: string;Name of the complex type.
Defined in
tmp/commons/src/lib/utils/xsd.ts:77
Accessors
attrs
get attrs(): Attribute[]Attributes of the complex type.
Returns
Defined in
tmp/commons/src/lib/utils/xsd.ts:81
childTypes
get childTypes(): string[]Returns
string[]
Defined in
tmp/commons/src/lib/utils/xsd.ts:99
optionalChildren
get optionalChildren(): ChildProps[]Returns
Defined in
tmp/commons/src/lib/utils/xsd.ts:103
optionalChildTypes
get optionalChildTypes(): string[]Returns
string[]
Defined in
tmp/commons/src/lib/utils/xsd.ts:107
requiredChildren
get requiredChildren(): ChildProps[]Returns
Defined in
tmp/commons/src/lib/utils/xsd.ts:111
uniqueChildren
get uniqueChildren(): ChildProps[]Returns
Defined in
tmp/commons/src/lib/utils/xsd.ts:115
Methods
toJSON()
toJSON(): objectReturns
object
attributes
attributes: Attribute[];children
children: object[];doc
doc: undefined | string;name
name: string;Defined in
tmp/commons/src/lib/utils/xsd.ts:119
fromObject()
static fromObject(__namedParameters): ComplexTypeParameters
• __namedParameters
• __namedParameters.attributes: Attribute[]
• __namedParameters.children: object[]
• __namedParameters.doc: undefined | string
• __namedParameters.name: string
Returns
Defined in
tmp/commons/src/lib/utils/xsd.ts:128
XmlSchema
Type of an XML schema definition.
It defines the types allowed in an xml file, usually derived from an xsd file.
Constructors
new XmlSchema()
new XmlSchema(): XmlSchemaReturns
Properties
complexTypes
complexTypes: Map<string, ComplexType>;Complex types of the xml schema.
Defined in
tmp/commons/src/lib/utils/xsd.ts:169
simpleTypes
simpleTypes: Map<string, SimpleType>;Simple types of the xml schema.
Defined in
tmp/commons/src/lib/utils/xsd.ts:167
Accessors
parentsMap
get parentsMap(): Map<string, string[]>Map which associates the names of complex XML types to their parents’ names.
Returns
Map<string, string[]>
Defined in
tmp/commons/src/lib/utils/xsd.ts:193
roots
get roots(): string[]Roots of the XML schema.
Returns
string[]
Defined in
tmp/commons/src/lib/utils/xsd.ts:208
simpleTypeMap
get simpleTypeMap(): Map<string, SimpleType>Map which associates the names of simple XML types to their definition.
Returns
Map<string, SimpleType>
Defined in
tmp/commons/src/lib/utils/xsd.ts:172
tree
get tree(): XMLTypeTreeTree representation of the XML schema.
It is a recursive structure that represents the hierarchy of the types in the schema.
Returns
Defined in
tmp/commons/src/lib/utils/xsd.ts:221
typeMap
get typeMap(): Map<string, ComplexType>Map which associates the names of complex XML types to their definitions.
Returns
Map<string, ComplexType>
Defined in
tmp/commons/src/lib/utils/xsd.ts:177
typePaths
get typePaths(): Map<string, string[][] | "infinite">Map which associates the names of complex XML types to their possible paths in an XML file.
The paths are represented as an array of type names. If a type is recursive, the value is ‘infinite’.
Returns
Map<string, string[][] | "infinite">
Defined in
tmp/commons/src/lib/utils/xsd.ts:247
Methods
addComplexType()
addComplexType(...complexs): voidParameters
• …complexs: ComplexType[]
Returns
void
Defined in
tmp/commons/src/lib/utils/xsd.ts:181
addSimpleType()
addSimpleType(...simples): voidParameters
• …simples: SimpleType[]
Returns
void
Defined in
tmp/commons/src/lib/utils/xsd.ts:186
toJSON()
toJSON(): objectReturns
object
complexTypes
complexTypes: object[];simpleTypes
simpleTypes: SimpleType[];Defined in
tmp/commons/src/lib/utils/xsd.ts:160
fromJSON()
static fromJSON(data): XmlSchemaParameters
• data
• data.complexTypes: object[] = ...
• data.simpleTypes: SimpleType[] = ...
Returns
Defined in
tmp/commons/src/lib/utils/xsd.ts:154
Type Aliases
Attribute
type Attribute: object;An attribute of a complex type in an XML schema.
Type declaration
default
default: unknown;Default value of the attribute.
doc?
optional doc: string;Documentation of the attribute. Extracted from comment or annotation.
name
name: string;Name of the attribute.
required
required: boolean;Is the attribute required.
type
type: string;Data type of the attribute.
Defined in
tmp/commons/src/lib/utils/xsd.ts:28
SimpleType
type SimpleType: object;A simple datatype in an XML schema.
Type declaration
doc?
optional doc: string;Documentation of the simple type. Extracted from comments or annotations.
name
name: string;Name of the simple type.
options?
optional options: string[];Options if type is an enum.
pattern?
optional pattern: string;Regex to validate the type.
Defined in
tmp/commons/src/lib/utils/xsd.ts:14
XMLTypeName
type XMLTypeName: string;Type alias to make code more explicit.
Defined in
tmp/commons/src/lib/utils/xsd.ts:147
XMLTypeTree
type XMLTypeTree: object;A tree view of an XML schema.
It is a recursive structure that represents the hierarchy of types in a schema.
Index Signature
[key: string]: XMLTypeTree | "recursive"
Defined in
tmp/commons/src/lib/utils/xsd.ts:144
Functions
parseXsd()
function parseXsd(xsd): Promise<XmlSchema | undefined>Parses an XML schema from an XSD string.
Parameters
• xsd: string
xsd string
Returns
Promise<XmlSchema | undefined>
XMLSchema, or undefined if the string could not be parsed
Defined in
tmp/commons/src/lib/utils/xsd.ts:274
parseXsdFromUrl()
function parseXsdFromUrl(url): Promise<XmlSchema | undefined>Parses an XML schema from the url of an XSD file.
Parameters
• url: string
url of the xsd file
Returns
Promise<XmlSchema | undefined>
XMLSchema, or undefined if the file could not be fetched or parsed