Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 :
21 : #include "SchemaContext.hxx"
22 :
23 : #include "SchemaSimpleTypeContext.hxx"
24 :
25 : #include <xmloff/xmltoken.hxx>
26 : #include <xmloff/nmspmap.hxx>
27 : #include <xmloff/xmlnmspe.hxx>
28 : #include <xmloff/xmltkmap.hxx>
29 : #include <xmloff/xmluconv.hxx>
30 :
31 : #include <com/sun/star/beans/XPropertySet.hpp>
32 : #include <com/sun/star/xsd/WhiteSpaceTreatment.hpp>
33 : #include <com/sun/star/xforms/XDataTypeRepository.hpp>
34 :
35 : using rtl::OUString;
36 : using com::sun::star::uno::Reference;
37 : using com::sun::star::uno::Any;
38 : using com::sun::star::xml::sax::XAttributeList;
39 : using com::sun::star::xforms::XDataTypeRepository;
40 : using namespace xmloff::token;
41 :
42 :
43 :
44 :
45 : static SvXMLTokenMapEntry aAttributes[] =
46 : {
47 : XML_TOKEN_MAP_END
48 : };
49 :
50 : static SvXMLTokenMapEntry aChildren[] =
51 : {
52 : TOKEN_MAP_ENTRY( XSD, SIMPLETYPE ),
53 : XML_TOKEN_MAP_END
54 : };
55 :
56 :
57 0 : SchemaContext::SchemaContext(
58 : SvXMLImport& rImport,
59 : sal_uInt16 nPrefix,
60 : const OUString& rLocalName,
61 : const Reference<XDataTypeRepository>& rRepository ) :
62 : TokenContext( rImport, nPrefix, rLocalName, aAttributes, aChildren ),
63 0 : mxRepository( rRepository )
64 : {
65 0 : }
66 :
67 0 : SchemaContext::~SchemaContext()
68 : {
69 0 : }
70 :
71 0 : void SchemaContext::HandleAttribute(
72 : sal_uInt16,
73 : const OUString& )
74 : {
75 0 : }
76 :
77 0 : SvXMLImportContext* SchemaContext::HandleChild(
78 : sal_uInt16 nToken,
79 : sal_uInt16 nPrefix,
80 : const OUString& rLocalName,
81 : const Reference<XAttributeList>& )
82 : {
83 : return ( nToken == XML_SIMPLETYPE )
84 0 : ? new SchemaSimpleTypeContext( GetImport(), nPrefix, rLocalName,
85 0 : mxRepository )
86 0 : : new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
87 : }
88 :
89 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|