equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
560 } |
560 } |
561 if (args[i].equals("-dtd")) { |
561 if (args[i].equals("-dtd")) { |
562 schemaLanguage = Language.DTD; |
562 schemaLanguage = Language.DTD; |
563 return 1; |
563 return 1; |
564 } |
564 } |
565 if (args[i].equals("-relaxng")) { |
|
566 schemaLanguage = Language.RELAXNG; |
|
567 return 1; |
|
568 } |
|
569 if (args[i].equals("-relaxng-compact")) { |
|
570 schemaLanguage = Language.RELAXNG_COMPACT; |
|
571 return 1; |
|
572 } |
|
573 if (args[i].equals("-xmlschema")) { |
565 if (args[i].equals("-xmlschema")) { |
574 schemaLanguage = Language.XMLSCHEMA; |
566 schemaLanguage = Language.XMLSCHEMA; |
575 return 1; |
567 return 1; |
576 } |
568 } |
577 if (args[i].equals("-wsdl")) { |
569 if (args[i].equals("-wsdl")) { |
867 // otherwise, use the file extension. |
859 // otherwise, use the file extension. |
868 // not a good solution, but very easy. |
860 // not a good solution, but very easy. |
869 if ((grammars != null) && (grammars.size() > 0)) { |
861 if ((grammars != null) && (grammars.size() > 0)) { |
870 String name = grammars.get(0).getSystemId().toLowerCase(); |
862 String name = grammars.get(0).getSystemId().toLowerCase(); |
871 |
863 |
872 if (name.endsWith(".rng")) |
|
873 return Language.RELAXNG; |
|
874 if (name.endsWith(".rnc")) |
|
875 return Language.RELAXNG_COMPACT; |
|
876 if (name.endsWith(".dtd")) |
864 if (name.endsWith(".dtd")) |
877 return Language.DTD; |
865 return Language.DTD; |
878 if (name.endsWith(".wsdl")) |
866 if (name.endsWith(".wsdl")) |
879 return Language.WSDL; |
867 return Language.WSDL; |
880 } |
868 } |