]>
Commit | Line | Data |
---|---|---|
a13899c5 | 1 | /** @file\r |
2 | \r | |
3 | The file is used to config XML file format\r | |
4 | \r | |
5 | Copyright (c) 2006, Intel Corporation\r | |
6 | All rights reserved. This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | package org.tianocore.frameworkwizard.common;\r | |
17 | \r | |
18 | import org.apache.xmlbeans.XmlCursor;\r | |
19 | import org.apache.xmlbeans.XmlOptions;\r | |
20 | \r | |
21 | public class XmlConfig {\r | |
22 | public static XmlCursor setupXmlCursor(XmlCursor cursor) {\r | |
23 | String uri = "http://www.TianoCore.org/2006/Edk2.0";\r | |
24 | cursor.push();\r | |
25 | cursor.toNextToken();\r | |
26 | cursor.insertNamespace("", uri);\r | |
27 | cursor.insertNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");\r | |
28 | cursor.pop();\r | |
29 | return cursor;\r | |
30 | }\r | |
31 | \r | |
32 | public static XmlOptions setupXmlOptions() {\r | |
33 | XmlOptions options = new XmlOptions();\r | |
34 | options.setCharacterEncoding("UTF-8");\r | |
35 | options.setSavePrettyPrint();\r | |
36 | options.setSavePrettyPrintIndent(2);\r | |
37 | return options;\r | |
38 | }\r | |
39 | \r | |
40 | }\r |