Table of Contents

Variable: createXs_restriction

const createXs_restriction: (attributes: Omit<Omit<Record<string, string | undefined> & {
[qualifiedName: `${string}:${string}`]: string | undefined;
}, "id"> & {
  id?: string;
} & {
[qualifiedName: `${string}:${string}`]: string | undefined;
}, "base"> & {
  base?: string;
} & {
[qualifiedName: `${string}:${string}`]: string | undefined;
}, content: 
  | Xs_restriction$Children
  | (
  | string
  | {
  kind: "comment";
  value: string;
}
  | {
  kind: "instruction";
  target: string;
  value: string;
}
  | Xs_annotation
  | Xs_simpleType_Element
  | Xs_minExclusive
  | Xs_minInclusive
  | Xs_maxExclusive
  | Xs_maxInclusive
  | Xs_totalDigits
  | Xs_fractionDigits
  | Xs_length
  | Xs_minLength
  | Xs_maxLength
  | Xs_enumeration
  | Xs_whiteSpace
  | Xs_pattern)[]) => Xs_restriction & {
  all: (parent?: {
     attributes: Record<string, string | undefined> & {
      [qualifiedName: `${string}:${string}`]: string | undefined;
     };
     content: (
        | string
        | {
        kind: "comment";
        value: string;
      }
        | {
        kind: "instruction";
        target: string;
        value: string;
      }
        | {
        attributes: Record<string, ... | ...> & {
         [qualifiedName: `${(...)}:${(...)}`]: ... | ...;
        };
        content: (string | XmlComment | XmlInstruction | GenericElement)[];
        name: string;
        namespaces?: Record<string, string>;
        namespaceURI: string;
        prefix?: string;
     })[];
     name: string;
     namespaces?: Record<string, string>;
     namespaceURI: string;
     prefix?: string;
  }) => Xs_restriction[];
  descendants: (parent?: {
     attributes: Record<string, string | undefined> & {
      [qualifiedName: `${string}:${string}`]: string | undefined;
     };
     content: (
        | string
        | {
        kind: "comment";
        value: string;
      }
        | {
        kind: "instruction";
        target: string;
        value: string;
      }
        | {
        attributes: Record<string, ... | ...> & {
         [qualifiedName: `${(...)}:${(...)}`]: ... | ...;
        };
        content: (string | XmlComment | XmlInstruction | GenericElement)[];
        name: string;
        namespaces?: Record<string, string>;
        namespaceURI: string;
        prefix?: string;
     })[];
     name: string;
     namespaces?: Record<string, string>;
     namespaceURI: string;
     prefix?: string;
  }) => Xs_restriction[];
  elementName: string;
  from: (parent?: {
     attributes: Record<string, string | undefined> & {
      [qualifiedName: `${string}:${string}`]: string | undefined;
     };
     content: (
        | string
        | {
        kind: "comment";
        value: string;
      }
        | {
        kind: "instruction";
        target: string;
        value: string;
      }
        | {
        attributes: Record<string, ... | ...> & {
         [qualifiedName: `${(...)}:${(...)}`]: ... | ...;
        };
        content: (string | XmlComment | XmlInstruction | GenericElement)[];
        name: string;
        namespaces?: Record<string, string>;
        namespaceURI: string;
        prefix?: string;
     })[];
     name: string;
     namespaces?: Record<string, string>;
     namespaceURI: string;
     prefix?: string;
   }) => 
     | Xs_restriction
    | undefined;
  is: (element?: {
     attributes: Record<string, string | undefined> & {
      [qualifiedName: `${string}:${string}`]: string | undefined;
     };
     content: (
        | string
        | {
        kind: "comment";
        value: string;
      }
        | {
        kind: "instruction";
        target: string;
        value: string;
      }
        | {
        attributes: Record<string, ... | ...> & {
         [qualifiedName: `${(...)}:${(...)}`]: ... | ...;
        };
        content: (string | XmlComment | XmlInstruction | GenericElement)[];
        name: string;
        namespaces?: Record<string, string>;
        namespaceURI: string;
        prefix?: string;
     })[];
     name: string;
     namespaces?: Record<string, string>;
     namespaceURI: string;
     prefix?: string;
  }) => element is Xs_restriction;
  namespaceURI: string;
} & {
  defaults: Partial<Omit<Omit<Record<string, string | undefined> & {
   [qualifiedName: `${string}:${string}`]: string | undefined;
   }, "id"> & {
     id?: string;
   } & {
   [qualifiedName: `${string}:${string}`]: string | undefined;
   }, "base"> & {
     base?: string;
   } & {
   [qualifiedName: `${string}:${string}`]: string | undefined;
  }>;
  read(element?: {
     attributes: Record<string, string | undefined> & {
      [qualifiedName: `${string}:${string}`]: string | undefined;
     };
     content: (
        | string
        | {
        kind: "comment";
        value: string;
      }
        | {
        kind: "instruction";
        target: string;
        value: string;
      }
        | {
        attributes: Record<string, string | undefined> & {
         [qualifiedName: `${string}:${string}`]: string | undefined;
        };
        content: (string | XmlComment | XmlInstruction | GenericElement)[];
        name: string;
        namespaces?: Record<string, string>;
        namespaceURI: string;
        prefix?: string;
     })[];
     name: string;
     namespaces?: Record<string, string>;
     namespaceURI: string;
     prefix?: string;
   }): 
     | {
     attributes: Omit<Omit<Record<string, ... | ...> & {
      [qualifiedName: `${(...)}:${(...)}`]: ... | ...;
      }, "id"> & {
        id?: string;
      } & {
      [qualifiedName: `${string}:${string}`]: string | undefined;
      }, "base"> & {
        base?: string;
      } & {
      [qualifiedName: `${string}:${string}`]: string | undefined;
     };
     children: {
        annotation: Xs_annotation;
        enumeration: Xs_enumeration[];
        fractionDigits: Xs_fractionDigits[];
        length: Xs_length[];
        maxExclusive: Xs_maxExclusive[];
        maxInclusive: Xs_maxInclusive[];
        maxLength: Xs_maxLength[];
        minExclusive: Xs_minExclusive[];
        minInclusive: Xs_minInclusive[];
        minLength: Xs_minLength[];
        pattern: Xs_pattern[];
        simpleType: Xs_simpleType_Element;
        totalDigits: Xs_totalDigits[];
        whiteSpace: Xs_whiteSpace[];
     };
   }
    | undefined;
  update(element: Xs_restriction, attributes: Partial<E["attributes"]>, changes: Partial<F>): Xs_restriction;
};

Create/read the XML restriction element. base attribute and simpleType child are mutually exclusive, but one or other is required Named children follow XSD order and occurrence constraints.

Type Declaration

all

all: (parent?: {
  attributes: Record<string, string | undefined> & {
   [qualifiedName: `${string}:${string}`]: string | undefined;
  };
  content: (
     | string
     | {
     kind: "comment";
     value: string;
   }
     | {
     kind: "instruction";
     target: string;
     value: string;
   }
     | {
     attributes: Record<string, ... | ...> & {
      [qualifiedName: `${(...)}:${(...)}`]: ... | ...;
     };
     content: (string | XmlComment | XmlInstruction | GenericElement)[];
     name: string;
     namespaces?: Record<string, string>;
     namespaceURI: string;
     prefix?: string;
  })[];
  name: string;
  namespaces?: Record<string, string>;
  namespaceURI: string;
  prefix?: string;
}) => Xs_restriction[];

Parameters

parent?
attributes

Record<string, string | undefined> & { [qualifiedName: `${string}:${string}`]: string | undefined; }

content

( | string | { kind: "comment"; value: string; } | { kind: "instruction"; target: string; value: string; } | { attributes: Record<string, ... | ...> & { [qualifiedName: `${(...)}:${(...)}`]: ... | ...; }; content: (string | XmlComment | XmlInstruction | GenericElement)[]; name: string; namespaces?: Record<string, string>; namespaceURI: string; prefix?: string; })[]

name

string

namespaces?

Record<string, string>

namespaceURI

string

prefix?

string

Returns

Xs_restriction[]

descendants

descendants: (parent?: {
  attributes: Record<string, string | undefined> & {
   [qualifiedName: `${string}:${string}`]: string | undefined;
  };
  content: (
     | string
     | {
     kind: "comment";
     value: string;
   }
     | {
     kind: "instruction";
     target: string;
     value: string;
   }
     | {
     attributes: Record<string, ... | ...> & {
      [qualifiedName: `${(...)}:${(...)}`]: ... | ...;
     };
     content: (string | XmlComment | XmlInstruction | GenericElement)[];
     name: string;
     namespaces?: Record<string, string>;
     namespaceURI: string;
     prefix?: string;
  })[];
  name: string;
  namespaces?: Record<string, string>;
  namespaceURI: string;
  prefix?: string;
}) => Xs_restriction[];

Parameters

parent?
attributes

Record<string, string | undefined> & { [qualifiedName: `${string}:${string}`]: string | undefined; }

content

( | string | { kind: "comment"; value: string; } | { kind: "instruction"; target: string; value: string; } | { attributes: Record<string, ... | ...> & { [qualifiedName: `${(...)}:${(...)}`]: ... | ...; }; content: (string | XmlComment | XmlInstruction | GenericElement)[]; name: string; namespaces?: Record<string, string>; namespaceURI: string; prefix?: string; })[]

name

string

namespaces?

Record<string, string>

namespaceURI

string

prefix?

string

Returns

Xs_restriction[]

elementName

elementName: string = definition.name;

from

from: (parent?: {
  attributes: Record<string, string | undefined> & {
   [qualifiedName: `${string}:${string}`]: string | undefined;
  };
  content: (
     | string
     | {
     kind: "comment";
     value: string;
   }
     | {
     kind: "instruction";
     target: string;
     value: string;
   }
     | {
     attributes: Record<string, ... | ...> & {
      [qualifiedName: `${(...)}:${(...)}`]: ... | ...;
     };
     content: (string | XmlComment | XmlInstruction | GenericElement)[];
     name: string;
     namespaces?: Record<string, string>;
     namespaceURI: string;
     prefix?: string;
  })[];
  name: string;
  namespaces?: Record<string, string>;
  namespaceURI: string;
  prefix?: string;
}) => 
  | Xs_restriction
  | undefined;

Parameters

parent?
attributes

Record<string, string | undefined> & { [qualifiedName: `${string}:${string}`]: string | undefined; }

content

( | string | { kind: "comment"; value: string; } | { kind: "instruction"; target: string; value: string; } | { attributes: Record<string, ... | ...> & { [qualifiedName: `${(...)}:${(...)}`]: ... | ...; }; content: (string | XmlComment | XmlInstruction | GenericElement)[]; name: string; namespaces?: Record<string, string>; namespaceURI: string; prefix?: string; })[]

name

string

namespaces?

Record<string, string>

namespaceURI

string

prefix?

string

Returns

| Xs_restriction | undefined

is

is: (element?: {
  attributes: Record<string, string | undefined> & {
   [qualifiedName: `${string}:${string}`]: string | undefined;
  };
  content: (
     | string
     | {
     kind: "comment";
     value: string;
   }
     | {
     kind: "instruction";
     target: string;
     value: string;
   }
     | {
     attributes: Record<string, ... | ...> & {
      [qualifiedName: `${(...)}:${(...)}`]: ... | ...;
     };
     content: (string | XmlComment | XmlInstruction | GenericElement)[];
     name: string;
     namespaces?: Record<string, string>;
     namespaceURI: string;
     prefix?: string;
  })[];
  name: string;
  namespaces?: Record<string, string>;
  namespaceURI: string;
  prefix?: string;
}) => element is Xs_restriction;

Parameters

element?
attributes

Record<string, string | undefined> & { [qualifiedName: `${string}:${string}`]: string | undefined; }

content

( | string | { kind: "comment"; value: string; } | { kind: "instruction"; target: string; value: string; } | { attributes: Record<string, ... | ...> & { [qualifiedName: `${(...)}:${(...)}`]: ... | ...; }; content: (string | XmlComment | XmlInstruction | GenericElement)[]; name: string; namespaces?: Record<string, string>; namespaceURI: string; prefix?: string; })[]

name

string

namespaces?

Record<string, string>

namespaceURI

string

prefix?

string

Returns

element is Xs_restriction

namespaceURI

namespaceURI: string = definition.namespaceURI;

defaults

defaults: Partial<Omit<Omit<Record<string, string | undefined> & {
[qualifiedName: `${string}:${string}`]: string | undefined;
}, "id"> & {
  id?: string;
} & {
[qualifiedName: `${string}:${string}`]: string | undefined;
}, "base"> & {
  base?: string;
} & {
[qualifiedName: `${string}:${string}`]: string | undefined;
}>;

read()

read(element?: {
  attributes: Record<string, string | undefined> & {
   [qualifiedName: `${string}:${string}`]: string | undefined;
  };
  content: (
     | string
     | {
     kind: "comment";
     value: string;
   }
     | {
     kind: "instruction";
     target: string;
     value: string;
   }
     | {
     attributes: Record<string, string | undefined> & {
      [qualifiedName: `${string}:${string}`]: string | undefined;
     };
     content: (string | XmlComment | XmlInstruction | GenericElement)[];
     name: string;
     namespaces?: Record<string, string>;
     namespaceURI: string;
     prefix?: string;
  })[];
  name: string;
  namespaces?: Record<string, string>;
  namespaceURI: string;
  prefix?: string;
}): 
  | {
  attributes: Omit<Omit<Record<string, ... | ...> & {
   [qualifiedName: `${(...)}:${(...)}`]: ... | ...;
   }, "id"> & {
     id?: string;
   } & {
   [qualifiedName: `${string}:${string}`]: string | undefined;
   }, "base"> & {
     base?: string;
   } & {
   [qualifiedName: `${string}:${string}`]: string | undefined;
  };
  children: {
     annotation: Xs_annotation;
     enumeration: Xs_enumeration[];
     fractionDigits: Xs_fractionDigits[];
     length: Xs_length[];
     maxExclusive: Xs_maxExclusive[];
     maxInclusive: Xs_maxInclusive[];
     maxLength: Xs_maxLength[];
     minExclusive: Xs_minExclusive[];
     minInclusive: Xs_minInclusive[];
     minLength: Xs_minLength[];
     pattern: Xs_pattern[];
     simpleType: Xs_simpleType_Element;
     totalDigits: Xs_totalDigits[];
     whiteSpace: Xs_whiteSpace[];
  };
}
  | undefined;

Parameters

element?
attributes

Record<string, string | undefined> & { [qualifiedName: `${string}:${string}`]: string | undefined; }

content

( | string | { kind: "comment"; value: string; } | { kind: "instruction"; target: string; value: string; } | { attributes: Record<string, string | undefined> & { [qualifiedName: `${string}:${string}`]: string | undefined; }; content: (string | XmlComment | XmlInstruction | GenericElement)[]; name: string; namespaces?: Record<string, string>; namespaceURI: string; prefix?: string; })[]

name

string

namespaces?

Record<string, string>

namespaceURI

string

prefix?

string

Returns

| { attributes: Omit<Omit<Record<string, ... | ...> & { [qualifiedName: `${(...)}:${(...)}`]: ... | ...; }, "id"> & { id?: string; } & { [qualifiedName: `${string}:${string}`]: string | undefined; }, "base"> & { base?: string; } & { [qualifiedName: `${string}:${string}`]: string | undefined; }; children: { annotation: Xs_annotation; enumeration: Xs_enumeration[]; fractionDigits: Xs_fractionDigits[]; length: Xs_length[]; maxExclusive: Xs_maxExclusive[]; maxInclusive: Xs_maxInclusive[]; maxLength: Xs_maxLength[]; minExclusive: Xs_minExclusive[]; minInclusive: Xs_minInclusive[]; minLength: Xs_minLength[]; pattern: Xs_pattern[]; simpleType: Xs_simpleType_Element; totalDigits: Xs_totalDigits[]; whiteSpace: Xs_whiteSpace[]; }; } | undefined

update()

update(
   element: Xs_restriction, 
   attributes: Partial<E["attributes"]>, 
   changes: Partial<F>
): Xs_restriction;

Parameters

element

Xs_restriction

attributes

Partial<E["attributes"]>

changes

Partial<F>

Returns

Xs_restriction