diff --git a/src/xsd.ts b/src/xsd.ts index d9a1932..7a053b2 100644 --- a/src/xsd.ts +++ b/src/xsd.ts @@ -8,7 +8,6 @@ import {ExporterTS} from './xsd/ExporterTS' Cache.patchRequest(); -Namespace.register('http://www.w3.org/2001/XMLSchema', 'http://www.w3.org/2009/XMLSchema/XMLSchema.xsd', 'xsd'); Namespace.register('http://www.w3.org/XML/1998/namespace', 'http://www.w3.org/2001/xml.xsd', 'xml'); var loader = new Loader({ diff --git a/src/xsd/Loader.ts b/src/xsd/Loader.ts index e349a98..e0629eb 100644 --- a/src/xsd/Loader.ts +++ b/src/xsd/Loader.ts @@ -4,12 +4,12 @@ import {FetchOptions, Cache, CacheResult, util} from 'cget' import {Namespace} from './Namespace' import {Source} from './Source' -import {XsdParser} from '../XsdParser' +import {Parser} from './Parser' export class Loader { constructor(options?: FetchOptions) { this.options = util.clone(options); - this.parser = new XsdParser(); + this.parser = new Parser(); } import(urlRemote: string) { @@ -65,7 +65,7 @@ export class Loader { private static sourceTbl: {[url: string]: Source} = {}; private options: FetchOptions; - private parser: XsdParser; + private parser: Parser; private targetNamespace: Namespace; private pendingCount = 0; diff --git a/src/XsdParser.ts b/src/xsd/Parser.ts similarity index 94% rename from src/XsdParser.ts rename to src/xsd/Parser.ts index 85caf83..a332eb3 100644 --- a/src/XsdParser.ts +++ b/src/xsd/Parser.ts @@ -5,12 +5,12 @@ import * as expat from 'node-expat'; import * as Promise from 'bluebird'; import {FetchOptions, Cache, CacheResult} from 'cget'; -import * as types from './xsd/types'; -import {State, Rule} from './XsdState'; -import {Namespace} from './xsd/Namespace'; -import {Loader} from './xsd/Loader'; -import {Source} from './xsd/Source'; -import {QName} from './xsd/QName' +import * as types from './types'; +import {State, Rule} from './State'; +import {Namespace} from './Namespace'; +import {Loader} from './Loader'; +import {Source} from './Source'; +import {QName} from './QName' import * as util from 'util'; @@ -37,7 +37,7 @@ function parseRule(ctor: types.BaseClass) { return(rule); } -export class XsdParser { +export class Parser { constructor() { this.rootRule = parseRule(types.Root); } diff --git a/src/XsdState.ts b/src/xsd/State.ts similarity index 83% rename from src/XsdState.ts rename to src/xsd/State.ts index aefec92..cd07468 100644 --- a/src/XsdState.ts +++ b/src/xsd/State.ts @@ -4,12 +4,12 @@ import * as expat from 'node-expat'; import {FetchOptions, Cache} from 'cget' -import * as types from './xsd/types' -import {XsdParser} from './XsdParser' -import {Namespace} from './xsd/Namespace' -import {Source} from './xsd/Source' -import {Scope} from './xsd/Scope' -import {QName} from './xsd/QName' +import * as types from './types' +import {Parser} from './Parser' +import {Namespace} from './Namespace' +import {Source} from './Source' +import {Scope} from './Scope' +import {QName} from './QName' export class State { constructor(parent: State, rule: Rule, source?: Source) { diff --git a/src/xsd/types.ts b/src/xsd/types.ts index 13c79dd..f5c7009 100644 --- a/src/xsd/types.ts +++ b/src/xsd/types.ts @@ -1,11 +1,7 @@ // This file is part of fast-xml, copyright (c) 2015 BusFaster Ltd. // Released under the MIT license, see LICENSE. -import {State, Rule} from '../XsdState'; -import {XsdParser} from '../XsdParser'; -import {Namespace} from './Namespace'; -import {Source} from './Source'; -import {Scope} from './Scope'; +import {State} from './State'; import {QName} from './QName'; import {Base, BaseClass} from './types/Base'; diff --git a/src/xsd/types/Attribute.ts b/src/xsd/types/Attribute.ts index bd2aad3..1f67b52 100644 --- a/src/xsd/types/Attribute.ts +++ b/src/xsd/types/Attribute.ts @@ -1,7 +1,7 @@ // This file is part of fast-xml, copyright (c) 2015 BusFaster Ltd. // Released under the MIT license, see LICENSE. -import {State} from '../../XsdState'; +import {State} from '../State'; import {QName} from '../QName'; import * as types from '../types'; diff --git a/src/xsd/types/Base.ts b/src/xsd/types/Base.ts index c1cdac2..11d1cbf 100644 --- a/src/xsd/types/Base.ts +++ b/src/xsd/types/Base.ts @@ -1,7 +1,7 @@ // This file is part of fast-xml, copyright (c) 2015 BusFaster Ltd. // Released under the MIT license, see LICENSE. -import {State, Rule} from '../../XsdState'; +import {State, Rule} from '../State'; import {Namespace} from '../Namespace'; import {Scope} from '../Scope'; import {QName} from '../QName'; diff --git a/src/xsd/types/ComplexType.ts b/src/xsd/types/ComplexType.ts index 81333f2..47dc538 100644 --- a/src/xsd/types/ComplexType.ts +++ b/src/xsd/types/ComplexType.ts @@ -1,7 +1,7 @@ // This file is part of fast-xml, copyright (c) 2015 BusFaster Ltd. // Released under the MIT license, see LICENSE. -import {State} from '../../XsdState'; +import {State} from '../State'; import {QName} from '../QName'; import * as types from '../types'; diff --git a/src/xsd/types/Element.ts b/src/xsd/types/Element.ts index c440a2c..8262468 100644 --- a/src/xsd/types/Element.ts +++ b/src/xsd/types/Element.ts @@ -1,7 +1,7 @@ // This file is part of fast-xml, copyright (c) 2015 BusFaster Ltd. // Released under the MIT license, see LICENSE. -import {State} from '../../XsdState'; +import {State} from '../State'; import {QName} from '../QName'; import * as types from '../types'; diff --git a/src/xsd/types/Group.ts b/src/xsd/types/Group.ts index ac61aea..c9e3ecf 100644 --- a/src/xsd/types/Group.ts +++ b/src/xsd/types/Group.ts @@ -1,7 +1,7 @@ // This file is part of fast-xml, copyright (c) 2015 BusFaster Ltd. // Released under the MIT license, see LICENSE. -import {State} from '../../XsdState'; +import {State} from '../State'; import {QName} from '../QName'; import * as types from '../types'; diff --git a/src/xsd/types/Import.ts b/src/xsd/types/Import.ts index 6e837d5..a654872 100644 --- a/src/xsd/types/Import.ts +++ b/src/xsd/types/Import.ts @@ -1,7 +1,7 @@ // This file is part of fast-xml, copyright (c) 2015 BusFaster Ltd. // Released under the MIT license, see LICENSE. -import {State} from '../../XsdState'; +import {State} from '../State'; import {Namespace} from '../Namespace'; import * as types from '../types'; diff --git a/src/xsd/types/Schema.ts b/src/xsd/types/Schema.ts index dc216d8..1eab635 100644 --- a/src/xsd/types/Schema.ts +++ b/src/xsd/types/Schema.ts @@ -1,7 +1,7 @@ // This file is part of fast-xml, copyright (c) 2015 BusFaster Ltd. // Released under the MIT license, see LICENSE. -import {State} from '../../XsdState'; +import {State} from '../State'; import * as types from '../types'; /** Schema root element */