diff --git a/.classpath b/.classpath deleted file mode 100644 index b46784278..000000000 --- a/.classpath +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a11736399..5ea42e580 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,34 +35,39 @@ jobs: java-version: 8 - name: 'Build Xalan jars' run: | - ant jar + mvn --no-transfer-progress clean compile site verify - uses: actions/checkout@v3 name: 'Checkout xalan-test' with: repository: apache/xalan-test path: xalan-test ref: master + - name: 'Cheat xalan-test up to be sibling of xalan-java' + run: | + mv xalan-test ..; ls .. - name: 'Run xalan-test tests' - working-directory: xalan-test + working-directory: ../xalan-test # NOTE: "alltest" target includes conformance tests known not to run in Xalan, # as well as having dependencies on some targets which have since been edited # out. The following is our typical minimal build test as documented in README, # minus conf.xsltc since that one is currently throwing four known failures and # isn't set up to say "but that's not a regression". - run: | - ant jar extensions.classes smoketest apitest -Dxalan.relpath=../ -Dparserjar=../lib/endorsed/xercesImpl.jar -Dxml-apis.jar=../lib/endorsed/xml-apis.jar -# ant fulldist is failing: in CI -# /home/runner/work/xalan-java/xalan-java/build.xml:1399: /home/runner/work/xalan-java/xalan-test does not exist. -# Error replicated on my system if there is not a sibling xalan-test. -# NOT replicated if sibling xalan-test directory is present -# Simplest fix would be to have the above test checkout emulate the dev environment; -# better would be to fix fulldist to intelligently check both locations; -# best might be to adopt xalan-test back into the xalan repository, if it's no longer being used elsewhere. - - name: 'Cheat xalan-test up to be sibling of xalan-java' - run: | - mv xalan-test ..; ls .. - - id: build_artifacts +# NOTE: Adjustments made for mvn build leaving things in a slightly different +# place than ant build did (and recreating /lib). run: | - ant fulldist + ls; ant -debug jar extensions.classes smoketest apitest -Dxalan.relpath=../xalan-java -Dparserjar=../xalan-java/lib/xercesImpl-2.12.2.jar -Dxml-apis.jar=../xalan-java/lib/xml-apis-1.4.01.jar +# Build distribution artifacts: Used to pull xalan-test back down as child and +# run fulldist: +# run: | +# ant fulldist +# fulldist isn't currently a separate target in the mvn build process +# A near-equivalent is being performed every time to build the .tar.gz +# and .zip distribution files. +# +# BUT NOTE that the binary distro has traditionally included +# xalan-test as a subdirectory; maven build doesn't yet pull that in. +# Discussion is in progress about whether it is (a) necessary, (b) a good +# idea. +# TODO: REVIEW. diff --git a/.gitignore b/.gitignore index d35296208..6c5d53050 100644 --- a/.gitignore +++ b/.gitignore @@ -1,36 +1,41 @@ -/bin/ -/build/ -/classes/ -/.idea/ +# Maven output +target/ +**/dependency-reduced-pom.xml + +# In Maven, dependencies are downloaded during build; +# we don't want to check them in +/tools/ + +# Xalan "Ant emulation" directories for xalan-test and distribution, +# created by Maven build. +# (xalan-test referenced dependencies from xalan-java; distro may be +# publishing from lib/ though I hope not.) +build/ +lib/ + +# Eclipse configuration +.settings/ +.project +.classpath + +# IntelliJ IDEA +.idea/ *.iml -.DS_Store -# We download the dependencies if they are missing -/lib/ -/tools/java_cup.jar -/tmp/ +# MacOS Finder +.DS_Store -# Generated sources +# XPath parser generated during compilation /src/org/apache/xalan/processor/XSLProcessorVersion.java /src/org/apache/xalan/xsltc/compiler/XPathLexer.java /src/org/apache/xalan/xsltc/compiler/XPathParser.java /src/org/apache/xalan/xsltc/compiler/sym.java -/xdocs/sources/xalan/DONE -/xdocs/sources/xalan/XSLTCDONE - -# The following are unpacked from zipfile -# NOTE: Might be simpler to just check 'em in unzipped. -/xdocs/style/graphics/ -/xdocs/style/loader.xml -/xdocs/style/resources/ -/xdocs/style/stylesheets/any2header.xsl -/xdocs/style/stylesheets/any2project.xsl -/xdocs/style/stylesheets/book2group.xsl -/xdocs/style/stylesheets/book2project.xsl -/xdocs/style/stylesheets/changes2document.xsl -/xdocs/style/stylesheets/context2footer.xsl -/xdocs/style/stylesheets/context2label.xsl -/xdocs/style/stylesheets/directory2project.xsl -/xdocs/style/stylesheets/document2html.xsl -/xdocs/style/stylesheets/faqs2document.xsl -/xdocs/style/stylesheets/group2document.xsl + +# Stylebook processing progress flags. +/stylebook/sources/xalan/DONE +/stylebook/sources/xalan/XSLTCDONE + +# Various temporary/work directories used by other tools +/bin/ +/classes/ +/tmp/ diff --git a/.project b/.project deleted file mode 100644 index 56d086ee9..000000000 --- a/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - - xalan-j-trunk - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 5917cfb92..000000000 --- a/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,269 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning -org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=80 -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=80 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=space -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true diff --git a/.settings/org.eclipse.jdt.ui.prefs b/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 7e642675d..000000000 --- a/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,5 +0,0 @@ -#Mon Jul 14 00:07:56 EDT 2008 -eclipse.preferences.version=1 -formatter_profile=_Development -formatter_settings_version=11 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/NOTICE.txt b/NOTICE.txt index 5c9ce77c9..e88972d09 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -10,16 +10,16 @@ Copyright 1999-2012 The Apache Software Foundation This product includes software developed at - The Apache Software Foundation (http://www.apache.org/). + The Apache Software Foundation (http://www.apache.org/) ========================================================================= Portions of this software was originally based on the following: - - software copyright (c) 1999-2002, Lotus Development Corporation., - http://www.lotus.com. - - software copyright (c) 2001-2002, Sun Microsystems., - http://www.sun.com. - - software copyright (c) 2003, IBM Corporation., - http://www.ibm.com. + - software copyright (c) 1999-2002, Lotus Development Corporation, + http://www.lotus.com + - software copyright (c) 2001-2002, Sun Microsystems, + http://www.sun.com + - software copyright (c) 2003, IBM Corporation, + http://www.ibm.com ========================================================================= The binary distribution package (ie. jars, samples and documentation) of @@ -59,27 +59,27 @@ Copyright 1999-2022 The Apache Software Foundation This product includes software developed at - The Apache Software Foundation (http://www.apache.org/). + The Apache Software Foundation (http://www.apache.org/) Portions of Apache Xerces Java in xercesImpl.jar and xml-apis.jar were originally based on the following: - - software copyright (c) 1999, IBM Corporation., http://www.ibm.com. - - software copyright (c) 1999, Sun Microsystems., http://www.sun.com. + - software copyright (c) 1999, IBM Corporation, http://www.ibm.com + - software copyright (c) 1999, Sun Microsystems, http://www.sun.com - voluntary contributions made by Paul Eng on behalf of the Apache Software Foundation that were originally developed at iClick, Inc., - software copyright (c) 1999. + software copyright (c) 1999 ========================================================================= Apache xml-commons xml-apis (redistribution of xml-apis.jar) Apache XML Commons - Copyright 2001-2003,2006 The Apache Software Foundation. + Copyright 2001-2003, 2006 The Apache Software Foundation This product includes software developed at - The Apache Software Foundation (http://www.apache.org/). + The Apache Software Foundation (http://www.apache.org/) Portions of this software were originally based on the following: - - software copyright (c) 1999, IBM Corporation., http://www.ibm.com. - - software copyright (c) 1999, Sun Microsystems., http://www.sun.com. - - software copyright (c) 2000 World Wide Web Consortium, http://www.w3.org + - software copyright (c) 1999, IBM Corporation, http://www.ibm.com + - software copyright (c) 1999, Sun Microsystems, http://www.sun.com + - software copyright (c) 2000, World Wide Web Consortium, http://www.w3.org diff --git a/README b/README index 0fd73e9dd..59b949aee 100644 --- a/README +++ b/README @@ -14,110 +14,201 @@ * See the License for the specific language governing permissions and * limitations under the License. --> - +Apache Xalan-Java Build, Test, and Release Notes Copyright 1999-2023 The Apache Software Foundation Authors: Gary Gregory - Joe Kesselman + Joe Kesselman Mukul Gandhi -This file primarily, contains instructions to the person(s) who shall be making an Apache XalanJ -release for distribution, along with the instructions about how to test XalanJ release before -recommending the release for distribution. +This document's primarily focused on building artifacts for production +releases of the Apache Xalan-J XSLT processor, but may be helpful for +others working with Xalan's source. + +(0) Prerequisites + +Official Xalan builds are currently being performed using Maven +version 6.3.6 and a Java 1.8 Development Kit. We recommend Eclipse +Temurun for the latter; it is available from +https://adoptium.net/temurin/releases/?version=8. Be sure to install +the JDK, not just the JRE. + +The xalan tests, however, are still relying on Apache Ant. You can +obtain this from https://ant.apache.org/bindownload.cgi. I have been +testing with Ant 1.10.12, but have successfully built with 1.9.16 as +well. -The details mentioned within this file, may also be used, by XalanJ source distribution users to -build and test XalanJ from the source distribution (except that, "git clone" steps as mentioned -within this file, might not be required to be run by XalanJ source distribution users). (1) Steps to build the XalanJ release -1) Do a git clone, of the relevant XalanJ branches: +1.1) Obtain the source for XalanJ and its test package. + +"Source Distribution" jarfiles are available which contain a snapshot +of a particular release of the source code; extracting them with "jar +-xf" will yield the xalan-java and xalan-test directories. + +Or (usually preferred) you can use "git clone" to obtain these from +either github.com. or gitbox.apache.org. New development takes place +on the branch currently called "master", which git will fetch by default: + + git clone https://github.com/apache/xalan-java.git + git clone https://github.com/apache/xalan-test.git + +(In the past this code was hosted at gitbox.apache.org, but that now +redirects to the github copy.) + +If you want to build a specific release rather than the development +version, you can obtain that by adding the release's branch name to +the git clone operation. For example, to get the code released as +version 2.7.1, you would issue the command + + git clone https://github.com/apache/xalan-java.git --single-branch --branch xalan-j_2_7_1 + +There will also usually be a _maint branch, which is used for development and testing of "hot fixes" that will be made available as new point releases (for example, 2.7.1.1). You would access this as + + git clone https://github.com/apache/xalan-java.git --single-branch --branch xalan-j_2_7_1_maint -git clone --single-branch https://gitbox.apache.org/repos/asf/xalan-java.git -b xalan-j_2_7_1_maint +Whether you perform the git clone operations or unpack the source +distribution jarfiles, each produces its own folder: xalan-java and +xalan-test. Since xalan-test looks for code to be tested via the path +../xalan-java, these will need to be children of the same parent +directory for the tests to run. -git clone https://gitbox.apache.org/repos/asf/xalan-test.git -This creates two folders: xalan-java and xalan-test. These folders need to be parallel to -each other, to be able to follow the XalanJ build and tests steps as described in this document, -for making a XalanJ release for distribution. +1.2) Set JAVA_HOME and ANT_HOME environment variable. On Linux, assuming +a standard installation of the JDK with the "alternatives" tooling, +the easiest way to be sure you have the right JDK may be to use the +command -2) Set JAVA_HOME and ANT_HOME environment variables, for example on Windows: + export ANT_HOME=/usr/share/ant + export JAVA_HOME=$(readlink -f /etc/alternatives/java_sdk_1.8.0) -set JAVA_HOME=C:\Program Files\Eclipse Adoptium\jdk-8.0.352.8-hotspot\ +On Windows, you will probably need to set these more explicitly, and add them to your PATH: -set ANT_HOME=C:\java\apache-ant-1.10.12 + set ANT_HOME=C:\path\to\your\installed\apache-ant- + set JAVA_HOME=C:\Program Files\Eclipse Adoptium\jdk-8.0.352.8-hotspot\ + set PATH=%JAVA_HOME%;%ANT_HOME%;%PATH% -3) Run the command, "build clean fulldist" from folder xalan-java. -For XalanJ source distribution users, this command needs to be run from, the root -of the XalanJ source distribution folder (i.e, from the source distribution folder, -which contains folders "src", "tools" etc). +1.3) Go to the xalan-java source directory (i.e, from the source +distribution folder, which contains folders "src", "tools" etc), and +from there run the clean-and-distribution-build command: -(2) Steps to run the XalanJ tests, on XalanJ implementation + On Linux, run ./mvnbuild.sh + On Windows, run ./mvnbuild.bat -Note that, for XalanJ source distribution users, XalanJ implementation shall be -produced (that XalanJ source distribution users, might want to test) by running -the build command "build clean fulldist" from the root of the XalanJ source -distribution folder. +This will build: + ./target/site/apidocs: Javadoc for the Xalan code base -1) Go to the XalanJ tests repos's, local git clone folder: -cd ..\xalan-test + ./target/site/design: Architecture documentation for Xalan + (probably outdated) -For XalanJ source distribution users, xalan-test folder is located at the root of the XalanJ -source distribution folder (i.e, parallel to folders "src", "tools" etc within the main XalanJ -codebase folder location), from where XalanJ source distribution users may run XalanJ -tests, by using the "build" script located at this folder location. + ./target/site/xsltc: Architecture documentation for the Xalan bytecode + compilation operations (probably outdated) -2) Set JAVA_HOME and ANT_HOME environment variables, for example: + ./build/*.jar: Executable jarfiles for the XML Serializer, the Xalan + XSLT Processor, some old xsltc samples and the @xsl.usage taglet + we used in producing the Javadoc/apidocs (see above). -set JAVA_HOME=C:\Program Files\Eclipse Adoptium\jdk-8.0.352.8-hotspot\ +1.4) IMPORTANT: Until we get xalan-test updated, you will need to go to the +xalan-java/build directory and manually copy or rename the jarfiles to +remove the version number: -set ANT_HOME=C:\java\apache-ant-1.10.12 + Linux: + mv xalan-*.jar xalan.jar + mv serializer-*.jar serializer.jar + Windows: + ren xalan-*.jar xalan.jar + ren serializer-*.jar serializer.jar -3) Run the command "build clean jar" from folder xalan-test. This produces -the file testxsl.jar that acts as main XalanJ test driver, within folder xalan-test/java/build. -4) Run the necessary XalanJ tests as follows, +(2) Steps to run the XalanJ tests, assuming you have already build +xalan-java as discussed above: -The tests described below within points 4.1, 4.2, 4.3 need to be run from folder xalan-test. +2.1) Go to the xalan-tests local folder. If you have cloned xalan-java +and xalan-test from Git, it will be a sibling of xalan-java. -4.1 Run the ant target "smoketest", using following two commands in sequence shown below +BUT: For XalanJ source distribution users, the xalan-test folder is +shipped as a child of the xalan-java source folder (i.e, parallel to +folders "src", "tools" etc within the main XalanJ codebase folder +location). In theory you *should* be able to run the tests directly +from here, but if you run into trouble try moving xalan-test up to be +a sibling of xalan-java. -build extensions.classes +2.2) Ensure the JAVA_HOME, ANT_HOME, and (on Windows) PATH environment +variables have been set as discussed above. -build smoketest +2.3) Go to the xalan-test folder, and from there run a clean source +build. Unfortunately we don't currently have a single target for this, +so you need to spell out some of the supporting packages: -The final result of the command "build smoketest" should be following, + Linux: ./build.sh clean jar extensions.classes bugzilla.classes jira.classes + Windows: build clean jar extensions.classes bugzilla.classes jira.classes + +The jar target builds the main XalanJ test driver, testxsl.jar, which +acts as main XalanJ test driver. The .classes targets build supporting +code specific to testing XSLT Extensions or some old issues reported +via Bugzilla or (more recently) Jira. + + +2.4) From the xalan-test directory, you can run the necessary XalanJ +tests as follows: + +2.4.1) The most important test set is smoketest. This exercises all +the testcases known to work in Apache Xalan-J, while avoiding some +which have open issues against them. + +Make sure you have built the jar and extensions.classes, as +above. Then, from the xalan-test directory: + + Linux: ./build.sh smoketest + Windows: build smoketest + +At the end of the test run, smoketest should report: smoketest-pass: [echo] [minitest] CONGRATULATIONS! The Smoketest passed! - -4.2 Run the ant target "apitest", using following command -build apitest -The final result of the command "build apitest" should be following, +2.4.2) Run the ant target "apitest", using following command + + Linux: ./build.sh apitest + Windows: build apitest + +At the end of the test run, apitest should report: apitest-pass-file-check: [echo] [minitest] CONGRATULATIONS! The api tests passed! -4.3 Run the ant target "conf.xsltc", using the following command -build conf.xsltc +2.4.3) Run the ant target "conf.xsltc", using the following command -The final result of the command "build conf.xsltc" should be following, + Linux: ./build.sh conf.xsltc + Windows: build conf.xsltc -[echo] [minitest] CONGRATULATIONS! The conf.xsltc tests passed! - -The XalanJ XSLTC processor, producing compiled translets, is known to have certain issues -as summarized by the following jira tickets, for the respective mentioned XalanJ conf.xsltc -test cases as mentioned below (users shall currently see, these xalanj test cases as failing, -within the test build conf.xsltc's output). +At the end of the test run, conf.xsltc should report: -1) output63 https://issues.apache.org/jira/browse/XALANJ-2642 -2) idkey49 https://issues.apache.org/jira/browse/XALANJ-2640 -3) math111 https://issues.apache.org/jira/browse/XALANJ-2641 -4) whitespace35 https://issues.apache.org/jira/browse/XALANJ-2643 +[echo] [minitest] CONGRATULATIONS! The conf.xsltc tests passed! -These XSLT transformation issues, do not exist with the XalanJ interpretive processor. +PLEASE NOTE that XSLTC has some known issues, which will cause FAIL +reports during this test. These are not considered regressions, and +are specialcased so conf.xsltc reports "passed" despite them. There +are Jira tickets open to address these bugs, and when fixes become +available we will again insist that these tests pass. + + output63 https://issues.apache.org/jira/browse/XALANJ-2642 + idkey49 https://issues.apache.org/jira/browse/XALANJ-2640 + math111 https://issues.apache.org/jira/browse/XALANJ-2641 + whitespace35 https://issues.apache.org/jira/browse/XALANJ-2643 + +2.4.4) Other test targets exist, which are either subsets of the above +or are considered less essential for regression testing. You may want +to read through the build.xml file to find them. NOTE that one target, +"api", is currently missing, which causes the "all" target to fail; we +need to clean that up at some point. + +2.5) When bugs are reported, tests should be added (at least to the +jira test set) to demonstrate the problem. When bugs are fixed, those +tests should be migrated either to the appropriate category or to the +"contrib" bucket if they don't fit nicely anywhere else. If the bug report was in error, the test demonstrating the (correct but unexpected) behavior may be either discarded, or moved as above if we think it's a useful illustration. \ No newline at end of file diff --git a/commits.xml b/ancient_history.commits.xml similarity index 100% rename from commits.xml rename to ancient_history.commits.xml diff --git a/build.bat b/build.bat deleted file mode 100644 index 25c89b866..000000000 --- a/build.bat +++ /dev/null @@ -1,70 +0,0 @@ -@echo off -rem -rem ========================================================================== -rem = Licensed to the Apache Software Foundation (ASF) under one or more -rem = contributor license agreements. See the NOTICE file distributed with -rem = this work for additional information regarding copyright ownership. -rem = The ASF licenses this file to You under the Apache License, Version 2.0 -rem = (the "License"); you may not use this file except in compliance with -rem = the License. You may obtain a copy of the License at -rem = -rem = http://www.apache.org/licenses/LICENSE-2.0 -rem = -rem = Unless required by applicable law or agreed to in writing, software -rem = distributed under the License is distributed on an "AS IS" BASIS, -rem = WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -rem = See the License for the specific language governing permissions and -rem = limitations under the License. -rem ========================================================================== -rem -rem build.bat: Build Xalan-J 2.x using Ant -rem Author: XalanJ team -rem -rem Usage: build [ant-options] [targets] -rem -rem Setup: -rem 1) You must set JAVA_HOME -rem -rem 2) You can set ANT_HOME if you use your own Ant install - -echo. -echo Xalan-J 2.x Build -echo ----------------- - -if "%JAVA_HOME%"=="" goto noJavaHome - -if exist "%JAVA_HOME%\lib\tools.jar" ( - set _CLASSPATH=%JAVA_HOME%\lib\tools.jar -) - -set _JAVACMD=%JAVA_HOME%\bin\java - -rem Default ANT_HOME to the one what user has set -if not "%ANT_HOME%"=="" set _ANT_HOME=%ANT_HOME% -if "%ANT_HOME%"=="" set _ANT_HOME=. - -if exist "%_ANT_HOME%\tools\ant.jar" ( - set _ANT_JARS=%_ANT_HOME%\tools\ant.jar -) else ( - set _ANT_JARS=%_ANT_HOME%\lib\ant.jar;%_ANT_HOME%\lib\ant-launcher.jar -) - -set _CLASSPATH=%_CLASSPATH%;%_ANT_JARS% - -set XERCES_ENDORSED_DIR_PATH=lib\endorsed - -@echo on -"%_JAVACMD%" -mx1024m -Djava.endorsed.dirs=%XERCES_ENDORSED_DIR_PATH% -classpath "%_CLASSPATH%" org.apache.tools.ant.Main %1 %2 %3 %4 %5 %6 %7 %8 %9 -@echo off - -goto end - -:noJavaHome -echo Warning: JAVA_HOME environment variable is not set - -:end -rem Cleanup environment variables -set _JAVACMD= -set _CLASSPATH= -set _ANT_HOME= -set _ANT_JARS= diff --git a/build.sh b/build.sh deleted file mode 100644 index 4f7ac97c1..000000000 --- a/build.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/sh -# -#========================================================================= -# Copyright 2001-2023 The Apache Software Foundation. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#========================================================================= -# -# Name: build.sh -# Author: Joe Kesselman -# Fresh port from Mukul Gandhi's revised build.bat. -# WARNING: This currently does not include the hooks needed -# to make the script compatable with cygwin (unix/Linux shell -# and commands ported to run under Windows). See -# deprecated_build.sh to see how we handled the cygwin -# syntax differences back in 2001. These days, Windows users -# are more likely to use WSL, which simplifies matters. - -# See: build.xml - -# Setup: -# 1) You must set JAVA_HOME, for example, -# $ export JAVA_HOME=/etc/alternatives/java_sdk - -# 2) You can set ANT_HOME if you use your own Ant install, for example, -# $ export ANT_HOME=/usr/share/ant - -echo -echo Xalan-J test automation build -echo ----------------------------- - -if [ "$1" = "-h" ]; then - echo build.sh - executes Xalan Java-based test automation - echo Usage: build [target] [-D options] - echo Example: build api -DtestClass=TransformerAPITest -Dqetest.loggingLevel=30 - echo - echo You MUST export the JAVA_HOME environment variable to point to the JDK - echo You CAN export ANT_HOME environment variable if you use your own Ant install - - exit 1 -fi - -if [ "$JAVA_HOME" = "" ]; then - echo Warning: JAVA_HOME environment variable is not exported - echo You may have meant to set it to /etc/alternatives/java_sdk - exit 1 -fi - -if [ -f "$JAVA_HOME/lib/tools.jar" ]; then - CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar -fi - -JAVACMD=$JAVA_HOME/bin/java - -CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar - -# Since Linux has scoped environments, we don't need explicit temporary vars. -# Default is to use a copy of ant bundled with xalan-java. -if [ "$ANT_HOME" = "" ]; then - ANT_HOME=. -fi - -# Check user's ANT_HOME to make sure it actually has what we need -if [ -f "$ANT_HOME/tools/ant.jar" ]; then - ANT_JARS=$ANT_HOME/tools/ant.jar -else - ANT_JARS=$ANT_HOME/lib/ant.jar:$ANT_HOME/lib/ant-launcher.jar -fi - -CLASSPATH=$CLASSPATH:$ANT_JARS - -XERCES_ENDORSED_DIR_PATH=lib/endorsed - -XALAN_BUILD_DIR_PATH=../xalan-java/build:../build - -# Reminder: Note $* versus $@ distinction -echo Running:$JAVACMD -mx1024m -Djava.endorsed.dirs=$XERCES_ENDORSED_DIR_PATH -classpath "$CLASSPATH" org.apache.tools.ant.Main "$@" -$JAVACMD -mx1024m -Djava.endorsed.dirs=$XERCES_ENDORSED_DIR_PATH -classpath "$CLASSPATH" org.apache.tools.ant.Main "$@" - -echo "build.sh complete!" diff --git a/build.xml b/build.xml deleted file mode 100644 index 55c7d38e5..000000000 --- a/build.xml +++ /dev/null @@ -1,1936 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build_srcdist_xalan.xml b/build_srcdist_xalan.xml deleted file mode 100644 index 4b2d9d5d9..000000000 --- a/build_srcdist_xalan.xml +++ /dev/null @@ -1,1944 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build_srcdist_xalan_tests.xml b/build_srcdist_xalan_tests.xml deleted file mode 100644 index 2416aeb7f..000000000 --- a/build_srcdist_xalan_tests.xml +++ /dev/null @@ -1,1783 +0,0 @@ - - - - -build.xml:$Revision$ -Ant 1.4.1+ build script for compiling and running Xalan-J tests. - -Note that this is a slightly unusual Ant build.xml file, since we -support both compiling/packaging the Xalan-J tests themselves, as -well as a number of targets designed to execute the tests once -they're built. - -In general the compilation targets (i.e. ones that compile the -test classes themselves) do list their dependencies explicitly. -Targets that serve to execute tests do not normally list any -dependencies - users must manually 'build jar' first. - -@author shane_curcuru@lotus.com -@see build.bat - -This file has been written, to enable running XalanJ tests from -XalanJ source distribution. This file is largely, a copy of the -file build.xml provided by XalanJ xalan-test git repos. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/deprecated_build.sh b/deprecated_build.sh deleted file mode 100644 index e21d6e133..000000000 --- a/deprecated_build.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# -#========================================================================= -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#========================================================================= -# -# Name: build.sh Build Xalan-J 2.x using Ant -# Author: Shane Curcuru - -# Alternatively, you can just call "ant" - -echo "Xalan-J 2.x Build" -echo "-------------" - -_JAVACMD=$JAVA_HOME/bin/java -if [ "$JAVA_HOME" = "" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." - _JAVACMD=java -fi - -# Default locations of jars we depend on to run Ant on our build.xml file -if [ "$ANT_HOME" = "" ] ; then - ANT_HOME=. -fi -if [ "$ANT_JAR" = "" ] ; then - ANT_JAR=./tools/ant.jar -fi -if [ "$PARSER_JAR" = "" ] ; then - PARSER_JAR=./lib/endorsed/xercesImpl.jar -fi - -if [ "$XML_APIS_JAR" = "" ] ; then - XML_APIS_JAR=./lib/endorsed/xml-apis.jar -fi - -# Use _underscore prefix to not conflict with user's settings -# Default to UNIX-style pathing -CLPATHSEP=: -# if we're on a Windows box make it ; -uname | grep WIN && CLPATHSEP=\; -_CLASSPATH="$ANT_JAR${CLPATHSEP}$XML_APIS_JAR${CLPATHSEP}$PARSER_JAR${CLPATHSEP}$CLASSPATH" - -# Attempt to automatically add system classes to _CLASSPATH -if [ -f $JAVA_HOME/lib/tools.jar ] ; then - _CLASSPATH=${_CLASSPATH}${CLPATHSEP}${JAVA_HOME}/lib/tools.jar -fi - -if [ -f $JAVA_HOME/lib/classes.zip ] ; then - _CLASSPATH=${_CLASSPATH}${CLPATHSEP}${JAVA_HOME}/lib/classes.zip -fi - - -echo "Starting Ant with targets: $@" -echo " ...with classpath: $_CLASSPATH" - -"$_JAVACMD" $JAVA_OPTS -Dant.home=$ANT_HOME -classpath "$_CLASSPATH" org.apache.tools.ant.Main $@ - - - - diff --git a/distribution/pom.xml b/distribution/pom.xml new file mode 100644 index 000000000..76b19fe47 --- /dev/null +++ b/distribution/pom.xml @@ -0,0 +1,112 @@ + + 4.0.0 + + xalan + xalan-j + 2.7.3 + + + distribution + distribution + pom + + + + + xalan + serializer + + + xalan + xalan + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + create-distros + + + [1,) + + + + + maven-assembly-plugin + 3.6.0 + + + distro-assembly + package + + single + + + ${project.parent.build.finalName} + ../build + + src/assembly/bin.xml + + + + + source-release-assembly + package + + single + + + ${project.parent.build.finalName} + ../build + + src/assembly/src.xml + + gnu + + + + + + + + + + diff --git a/distribution/src/assembly/bin.xml b/distribution/src/assembly/bin.xml new file mode 100644 index 000000000..0d84acd71 --- /dev/null +++ b/distribution/src/assembly/bin.xml @@ -0,0 +1,105 @@ + + + bin + + zip + tar.gz + + false + + + true + + xalan:serializer + xalan:xalan + + + ${project.parent.name}_${project.parent.version} + false + + + + org.jboss.spec.javax.rmi:jboss-rmi-api_1.0_spec + + + + + + + true + + xalan:xalansamples + xalan:xalanservlet + xalan:xsltcapplet + xalan:xsltcbrazil + xalan:xsltcejb + xalan:xsltcservlet + + + ${project.parent.name}_${project.parent.version}/samples + false + + + + bcel-* + commons-lang3-* + java-cup-runtime** + regexp-* + serializer-* + xalan-* + + + + + + + + + + ${rootlocation}/lib + ${project.parent.name}_${project.parent.version} + + xercesImpl*.jar + xml-apis*.jar + + + + + .. + META-INF + + LICENSE.txt + NOTICE.txt + + + + + ../target/site + ${project.parent.name}_${project.parent.version}/docs + + + + ../samples + ${project.parent.name}_${project.parent.version}/samples + + target/** + src/site/** + + + + + ../samples/target/site/ + ${project.parent.name}_${project.parent.version}/samples + + **/*.html + + + + diff --git a/distribution/src/assembly/src.xml b/distribution/src/assembly/src.xml new file mode 100644 index 000000000..76bbf9003 --- /dev/null +++ b/distribution/src/assembly/src.xml @@ -0,0 +1,119 @@ + + + + + + + src + + zip + tar.gz + + + + + + .. + / + + false + + + **/target/** + lib/** + build/** + + %regex[(?!((?!${project.basedir}/)[^/]+/)*src/).*${project.basedir}.*] + + + + + %regex[\~$] + %regex[/\#.*\#$] + + + %regex[(?!((?!${project.basedir}/)[^/]+/)*src/)(.*/)?maven-eclipse\.xml] + %regex[(?!((?!${project.basedir}/)[^/]+/)*src/)(.*/)?\.project] + %regex[(?!((?!${project.basedir}/)[^/]+/)*src/)(.*/)?\.classpath] + %regex[(?!((?!${project.basedir}/)[^/]+/)*src/)(.*/)?\.idea] + %regex[(?!((?!${project.basedir}/)[^/]+/)*src/)(.*/)?[^/]*\.iws] + %regex[(?!((?!${project.basedir}/)[^/]+/)*src/)(.*/)?[^/]*\.ipr] + %regex[(?!((?!${project.basedir}/)[^/]+/)*src/)(.*/)?[^/]*\.iml] + %regex[(?!((?!${project.basedir}/)[^/]+/)*src/)(.*/)?\.settings(/.*)?] + %regex[(?!((?!${project.basedir}/)[^/]+/)*src/)(.*/)?\.externalToolBuilders(/.*)?] + %regex[(?!((?!${project.basedir}/)[^/]+/)*src/)(.*/)?\.deployables(/.*)?] + %regex[(?!((?!${project.basedir}/)[^/]+/)*src/)(.*/)?\.wtpmodules(/.*)?] + + + %regex[(?!((?!${project.basedir}/)[^/]+/)*src/)(.*/)?cobertura\.ser] + + + %regex[(?!((?!${project.basedir}/)[^/]+/)*src/)(.*/)?pom\.xml\.releaseBackup] + %regex[(?!((?!${project.basedir}/)[^/]+/)*src/)(.*/)?release\.properties] + + + + + + ../maven-shared-archive-resources/META-INF + / + + + + .. + / + + + KEYS + README + LICENSE.txt + NOTICE.txt + *.bat + *.sh + + **/pom.xml + **/stylebook/** + + + + + diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml new file mode 100644 index 000000000..b440dfe9e --- /dev/null +++ b/integration-tests/pom.xml @@ -0,0 +1,66 @@ + + + 4.0.0 + + + xalan + xalan-j + 2.7.3 + + + integration-tests + pom + + + + + xalan + serializer + + + xalan + xalan + + + xalan + xalansamples + + + + + + + + org.apache.maven.plugins + maven-invoker-plugin + + + integration-test + + install + run + + + + + src/it + ${project.build.directory}/it + verify + ${project.build.directory}/local-repo + + clean + test + + src/it/settings.xml + + ${project.version} + + true + + + + + + + diff --git a/integration-tests/src/it/VersionCheck_JarsOnBootClasspath/invoker.properties b/integration-tests/src/it/VersionCheck_JarsOnBootClasspath/invoker.properties new file mode 100644 index 000000000..3fe5fc416 --- /dev/null +++ b/integration-tests/src/it/VersionCheck_JarsOnBootClasspath/invoker.properties @@ -0,0 +1,4 @@ +# These are default values set in the Maven Invoker plugin configuration +#invoker.goals = clean test +#invoker.buildResult = success +#invoker.debug = false diff --git a/integration-tests/src/it/VersionCheck_JarsOnBootClasspath/pom.xml b/integration-tests/src/it/VersionCheck_JarsOnBootClasspath/pom.xml new file mode 100644 index 000000000..0cc458029 --- /dev/null +++ b/integration-tests/src/it/VersionCheck_JarsOnBootClasspath/pom.xml @@ -0,0 +1,64 @@ + + 4.0.0 + + org.apache.xalan.it + versions + 0.0.1-SNAPSHOT + + + UTF-8 + UTF-8 + + + + + xalan + serializer + @project.version@ + + + xalan + xalan + @project.version@ + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + @maven-compiler-plugin.version@ + + 1.8 + 1.8 + + + + org.codehaus.mojo + exec-maven-plugin + @exec-maven-plugin.version@ + + + display-versions + test + + exec + + + Versions + java + + -Xbootclasspath/a:${settings.localRepository}/xalan/serializer/@project.version@/serializer-@project.version@.jar${path.separator}${settings.localRepository}/xalan/xalan/@project.version@/xalan-@project.version@.jar + -classpath + ${project.build.outputDirectory} + Versions + + + + + + + + diff --git a/integration-tests/src/it/VersionCheck_JarsOnBootClasspath/src/main/java/Versions.java b/integration-tests/src/it/VersionCheck_JarsOnBootClasspath/src/main/java/Versions.java new file mode 100644 index 000000000..31c4666eb --- /dev/null +++ b/integration-tests/src/it/VersionCheck_JarsOnBootClasspath/src/main/java/Versions.java @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.xalan.Version; +import org.apache.xalan.processor.XSLProcessorVersion; + +public class Versions { + private static Class[] versionClasses = { + Version.class, + XSLProcessorVersion.class, + org.apache.xml.serializer.Version.class + }; + + public static void main(String[] args) throws ReflectiveOperationException { + for (Class versionClass : versionClasses) + System.out.printf("Class %s is %s boot classpath%n", + versionClass.getName(), + versionClass.getClassLoader() == null ? "on" : "not on" + ); + for (Class versionClass : versionClasses) + System.out.println(versionClass.getMethod("getVersion").invoke(null)); + } +} diff --git a/integration-tests/src/it/VersionCheck_JarsOnBootClasspath/verify.groovy b/integration-tests/src/it/VersionCheck_JarsOnBootClasspath/verify.groovy new file mode 100644 index 000000000..588068a08 --- /dev/null +++ b/integration-tests/src/it/VersionCheck_JarsOnBootClasspath/verify.groovy @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Replace leading zeroes in dev drop version number, e.g. 'D07' to 'D7', +// because this is what the version classes do, too +projectVersion = projectVersion.replaceAll("\\.D0*", ".D") + +def buildLogLines = new File(basedir, "build.log").readLines() +def expectedLogLines = [ + 'Class org.apache.xalan.Version is on boot classpath', + 'Class org.apache.xalan.processor.XSLProcessorVersion is on boot classpath', + 'Class org.apache.xml.serializer.Version is on boot classpath', + "Xalan Java $projectVersion", + "Xalan Processor Java $projectVersion", + "Xalan Serializer Java $projectVersion" +] + +// Find first expected log output line +def index = buildLogLines.indexOf(expectedLogLines[0]) +assert index > 0 : "First expected log line not found" +// Verify that all expected log lines exist in the expected order +assert buildLogLines[index..index + 5] == expectedLogLines : "Expected log lines not found" diff --git a/integration-tests/src/it/VersionCheck_JarsOnClasspath/invoker.properties b/integration-tests/src/it/VersionCheck_JarsOnClasspath/invoker.properties new file mode 100644 index 000000000..3fe5fc416 --- /dev/null +++ b/integration-tests/src/it/VersionCheck_JarsOnClasspath/invoker.properties @@ -0,0 +1,4 @@ +# These are default values set in the Maven Invoker plugin configuration +#invoker.goals = clean test +#invoker.buildResult = success +#invoker.debug = false diff --git a/integration-tests/src/it/VersionCheck_JarsOnClasspath/pom.xml b/integration-tests/src/it/VersionCheck_JarsOnClasspath/pom.xml new file mode 100644 index 000000000..3461449ed --- /dev/null +++ b/integration-tests/src/it/VersionCheck_JarsOnClasspath/pom.xml @@ -0,0 +1,57 @@ + + 4.0.0 + + org.apache.xalan.it + versions + 0.0.1-SNAPSHOT + + + UTF-8 + UTF-8 + + + + + xalan + serializer + @project.version@ + + + xalan + xalan + @project.version@ + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + @maven-compiler-plugin.version@ + + 1.8 + 1.8 + + + + org.codehaus.mojo + exec-maven-plugin + @exec-maven-plugin.version@ + + + display-versions + test + + java + + + Versions + + + + + + + diff --git a/integration-tests/src/it/VersionCheck_JarsOnClasspath/src/main/java/Versions.java b/integration-tests/src/it/VersionCheck_JarsOnClasspath/src/main/java/Versions.java new file mode 100644 index 000000000..31c4666eb --- /dev/null +++ b/integration-tests/src/it/VersionCheck_JarsOnClasspath/src/main/java/Versions.java @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.xalan.Version; +import org.apache.xalan.processor.XSLProcessorVersion; + +public class Versions { + private static Class[] versionClasses = { + Version.class, + XSLProcessorVersion.class, + org.apache.xml.serializer.Version.class + }; + + public static void main(String[] args) throws ReflectiveOperationException { + for (Class versionClass : versionClasses) + System.out.printf("Class %s is %s boot classpath%n", + versionClass.getName(), + versionClass.getClassLoader() == null ? "on" : "not on" + ); + for (Class versionClass : versionClasses) + System.out.println(versionClass.getMethod("getVersion").invoke(null)); + } +} diff --git a/integration-tests/src/it/VersionCheck_JarsOnClasspath/verify.groovy b/integration-tests/src/it/VersionCheck_JarsOnClasspath/verify.groovy new file mode 100644 index 000000000..2c9cc23d5 --- /dev/null +++ b/integration-tests/src/it/VersionCheck_JarsOnClasspath/verify.groovy @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Replace leading zeroes in dev drop version number, e.g. 'D07' to 'D7', +// because this is what the version classes do, too +projectVersion = projectVersion.replaceAll("\\.D0*", ".D") + +def buildLogLines = new File(basedir, "build.log").readLines() +def expectedLogLines = [ + 'Class org.apache.xalan.Version is not on boot classpath', + 'Class org.apache.xalan.processor.XSLProcessorVersion is not on boot classpath', + 'Class org.apache.xml.serializer.Version is not on boot classpath', + "Xalan Java $projectVersion", + "Xalan Processor Java $projectVersion", + "Xalan Serializer Java $projectVersion" +] + +// Find first expected log output line +def index = buildLogLines.indexOf(expectedLogLines[0]) +assert index > 0 : "First expected log line not found" +// Verify that all expected log lines exist in the expected order +assert buildLogLines[index..index + 5] == expectedLogLines : "Expected log lines not found" diff --git a/integration-tests/src/it/VersionCheck_ShadedJarOnBootClasspath/invoker.properties b/integration-tests/src/it/VersionCheck_ShadedJarOnBootClasspath/invoker.properties new file mode 100644 index 000000000..2333c022b --- /dev/null +++ b/integration-tests/src/it/VersionCheck_ShadedJarOnBootClasspath/invoker.properties @@ -0,0 +1,4 @@ +invoker.goals = clean verify +# These are default values set in the Maven Invoker plugin configuration +#invoker.buildResult = success +#invoker.debug = false diff --git a/integration-tests/src/it/VersionCheck_ShadedJarOnBootClasspath/pom.xml b/integration-tests/src/it/VersionCheck_ShadedJarOnBootClasspath/pom.xml new file mode 100644 index 000000000..f0be644d4 --- /dev/null +++ b/integration-tests/src/it/VersionCheck_ShadedJarOnBootClasspath/pom.xml @@ -0,0 +1,87 @@ + + 4.0.0 + + org.apache.xalan.it + versions + 0.0.1-SNAPSHOT + + + UTF-8 + UTF-8 + + + + + xalan + serializer + @project.version@ + + + xalan + xalan + @project.version@ + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + @maven-compiler-plugin.version@ + + 1.8 + 1.8 + + + + org.apache.maven.plugins + maven-shade-plugin + @maven-shade-plugin.version@ + + + package + + shade + + + + + org.apache.xalan + shaded.org.apache.xalan + + + org.apache.xml.serializer + shaded.org.apache.xml.serializer + + + + + + + + org.codehaus.mojo + exec-maven-plugin + @exec-maven-plugin.version@ + + + display-versions + verify + + exec + + + Versions + java + + -Xbootclasspath/a:${build.directory}/${build.finalName}.jar + Versions + + + + + + + + diff --git a/integration-tests/src/it/VersionCheck_ShadedJarOnBootClasspath/src/main/java/Versions.java b/integration-tests/src/it/VersionCheck_ShadedJarOnBootClasspath/src/main/java/Versions.java new file mode 100644 index 000000000..31c4666eb --- /dev/null +++ b/integration-tests/src/it/VersionCheck_ShadedJarOnBootClasspath/src/main/java/Versions.java @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.xalan.Version; +import org.apache.xalan.processor.XSLProcessorVersion; + +public class Versions { + private static Class[] versionClasses = { + Version.class, + XSLProcessorVersion.class, + org.apache.xml.serializer.Version.class + }; + + public static void main(String[] args) throws ReflectiveOperationException { + for (Class versionClass : versionClasses) + System.out.printf("Class %s is %s boot classpath%n", + versionClass.getName(), + versionClass.getClassLoader() == null ? "on" : "not on" + ); + for (Class versionClass : versionClasses) + System.out.println(versionClass.getMethod("getVersion").invoke(null)); + } +} diff --git a/integration-tests/src/it/VersionCheck_ShadedJarOnBootClasspath/verify.groovy b/integration-tests/src/it/VersionCheck_ShadedJarOnBootClasspath/verify.groovy new file mode 100644 index 000000000..6d12efc2d --- /dev/null +++ b/integration-tests/src/it/VersionCheck_ShadedJarOnBootClasspath/verify.groovy @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Replace leading zeroes in dev drop version number, e.g. 'D07' to 'D7', +// because this is what the version classes do, too +projectVersion = projectVersion.replaceAll("\\.D0*", ".D") + +def buildLogLines = new File(basedir, "build.log").readLines() +def expectedLogLines = [ + 'Class shaded.org.apache.xalan.Version is on boot classpath', + 'Class shaded.org.apache.xalan.processor.XSLProcessorVersion is on boot classpath', + 'Class shaded.org.apache.xml.serializer.Version is on boot classpath', + "Xalan Java $projectVersion", + "Xalan Processor Java $projectVersion", + "Xalan Serializer Java $projectVersion" +] + +// Find first expected log output line +def index = buildLogLines.indexOf(expectedLogLines[0]) +assert index > 0 : "First expected log line not found" +// Verify that all expected log lines exist in the expected order +assert buildLogLines[index..index + 5] == expectedLogLines : "Expected log lines not found" diff --git a/integration-tests/src/it/settings.xml b/integration-tests/src/it/settings.xml new file mode 100644 index 000000000..68f4b2ddd --- /dev/null +++ b/integration-tests/src/it/settings.xml @@ -0,0 +1,54 @@ + + + + + + + + it-repo + + true + + + + local.central + @localRepositoryUrl@ + + true + + + true + + + + + + local.central + @localRepositoryUrl@ + + true + + + true + + + + + + diff --git a/lib/bcel-6.7.0.jar b/lib/bcel-6.7.0.jar deleted file mode 100644 index fb36e1d38..000000000 Binary files a/lib/bcel-6.7.0.jar and /dev/null differ diff --git a/lib/brazil-2.1.jar b/lib/brazil-2.1.jar deleted file mode 100644 index 78a1e784f..000000000 Binary files a/lib/brazil-2.1.jar and /dev/null differ diff --git a/lib/bsf.jar b/lib/bsf.jar deleted file mode 100644 index 302896730..000000000 Binary files a/lib/bsf.jar and /dev/null differ diff --git a/lib/commons-logging-1.2.jar b/lib/commons-logging-1.2.jar deleted file mode 100644 index 93a3b9f6d..000000000 Binary files a/lib/commons-logging-1.2.jar and /dev/null differ diff --git a/lib/endorsed/xercesImpl.jar b/lib/endorsed/xercesImpl.jar deleted file mode 100644 index ccbae9f45..000000000 Binary files a/lib/endorsed/xercesImpl.jar and /dev/null differ diff --git a/lib/endorsed/xml-apis.jar b/lib/endorsed/xml-apis.jar deleted file mode 100644 index 4f677fc86..000000000 Binary files a/lib/endorsed/xml-apis.jar and /dev/null differ diff --git a/lib/javaee-api-5.0-2.jar b/lib/javaee-api-5.0-2.jar deleted file mode 100644 index 65acd770a..000000000 Binary files a/lib/javaee-api-5.0-2.jar and /dev/null differ diff --git a/lib/regexp.jar b/lib/regexp.jar deleted file mode 100644 index 713441c52..000000000 Binary files a/lib/regexp.jar and /dev/null differ diff --git a/lib/rhino-1.7.14.jar b/lib/rhino-1.7.14.jar deleted file mode 100644 index ad47a2015..000000000 Binary files a/lib/rhino-1.7.14.jar and /dev/null differ diff --git a/lib/runtime.jar b/lib/runtime.jar deleted file mode 100644 index c74baf197..000000000 Binary files a/lib/runtime.jar and /dev/null differ diff --git a/lib/servlet-api-2.5.jar b/lib/servlet-api-2.5.jar deleted file mode 100644 index b0537c4db..000000000 Binary files a/lib/servlet-api-2.5.jar and /dev/null differ diff --git a/mvnbuild.bat b/mvnbuild.bat new file mode 100644 index 000000000..7fe831aad --- /dev/null +++ b/mvnbuild.bat @@ -0,0 +1 @@ +mvn clean package site diff --git a/mvnbuild.sh b/mvnbuild.sh new file mode 100755 index 000000000..7fe831aad --- /dev/null +++ b/mvnbuild.sh @@ -0,0 +1 @@ +mvn clean package site diff --git a/pom.xml b/pom.xml new file mode 100644 index 000000000..c5d459543 --- /dev/null +++ b/pom.xml @@ -0,0 +1,593 @@ + + + + pom + + 4.0.0 + xalan + xalan-j + 2.7.3 + + + UTF-8 + + "stylebook/stylebook-1.0-b3_xalan-2.jar${path.separator}serializer/target/classes${path.separator}xalan/target/classes${path.separator}" + + 3.11.0 + 3.1.0 + 3.5.1 + 5.10.1 + + 4.11.0 + 3.6.0 + 3.3.0 + + + + serializer + xalan + xalansamples + xalanservlet + xsltcapplet + xsltcbrazil + xsltcejb + xsltcservlet + + distribution + + + + + jdk8 + + [,9) + + + xalan2jtaglet + + + xalan2jtaglet + + + + jdk9+ + + [9,) + + + xalan2jtaglet_jdk9 + + -XX:+EnableDynamicAgentLoading + + + xalan2jtaglet_jdk9 + + + + create-docs + + + [1,) + + + + + + org.codehaus.mojo + exec-maven-plugin + ${exec-maven-plugin.version} + false + + + Xalan2 design documentation + package + + exec + + + java + -cp ${stylebook.classpath} org.apache.stylebook.StyleBook + loaderConfig=sbk:/style/loaderdesign.xml targetDirectory=./target/site/design/ + ./stylebook/sources/xalandesign.xml ./stylebook/style + + + + + Xalan2 compiled (xsltc) documentation + package + + exec + + + java + -cp ${stylebook.classpath} org.apache.stylebook.StyleBook + loaderConfig=sbk:/style/loaderdesign.xml targetDirectory=./target/site/xsltc/ + ./stylebook/sources/xsltc.xml ./stylebook/style + + + + Xalan2 interpretive documentation + package + + exec + + + java + -cp ${stylebook.classpath} org.apache.stylebook.StyleBook + loaderConfig=sbk:/style/loaderdesign.xml targetDirectory=./target/site/xalan + ./stylebook/sources/xalan-jsite.xml ./stylebook/style + + + + + + Xalan2 interpretive documentation, local + package + + exec + + + java + -cp ${stylebook.classpath} org.apache.stylebook.StyleBook + loaderConfig=sbk:/style/loaderdesign.xml targetDirectory=./target/site/xalan/local + ./stylebook/sources/xalan-jlocal.xml ./stylebook/style + + + + + + + + + integration-tests + + + [1,) + + + integration-tests + + + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.6.1 + + + copy-artifact + package + + copy + + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + ${project.packaging} + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + ${project.packaging} + + ${project.artifactId}.${project.packaging} + + + ${rootlocation}/build + + + + copy-dependencies + package + + copy-dependencies + + + ${rootlocation}/lib + false + false + true + + xalan + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + 1.8 + 1.8 + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.2.2 + + ${maven-surefire-plugin.argLine} + + + + + org.apache.maven.plugins + maven-invoker-plugin + 3.6.0 + + + org.codehaus.mojo + build-helper-maven-plugin + 3.5.0 + + + root-location + + rootlocation + + + + + + org.apache.maven.plugins + maven-shade-plugin + ${maven-shade-plugin.version} + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven-javadoc-plugin.version} + + + + none + + true + + 8 + 1.8 + + + + + xalan2jtaglet.XSLUsageTag + + + + xalan + ${xalan.taglet.artifactId} + ${project.version} + + + + + + XPath + org.apache.xpath* + + + Document Table Model (DTM) + org.apache.xml.dtm* + + + Utilities + org.apache.xml.utils* + + + Xalan Other + org.apache.xalan.client:org:org.apache.xalan.extensions:org.apache.xalan.res:org.apache.xalan.stree:org.apache.xalan.trace:org.apache.xalan.xslt + + + Xalan Extensions + org.apache.xalan.lib* + + + Serializers + org.apache.xml.serialize*:org.apache.xalan.serialize + + + SAX 2 + org.xml.sax* + + + DOM 2 + org.w3c.dom* + + + XSLTC Core + org.apache.xalan.xsltc* + + + Samples + samples* + + + + + + + javadoc-jar + package + + jar + + + + + + + + org.apache.maven.plugins + maven-source-plugin + ${maven-source-plugin.version} + + + source-jar + package + + jar-no-fork + + + + + + + + + src/main/java + + + META-INF + + LICENSE.txt + NOTICE.txt + + + + resources + + **/*.properties + + + + + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.4.5 + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.3.2 + + + + ./build + false + + + ./lib + false + + + + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.0.2 + + + copy-resources + package + + copy-resources + + + ${basedir}/target/site/xsltc + + + stylebook/sources/xsltc + + README.x* + + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + + + + + + + + + xalan + serializer + ${project.version} + + + xalan + xalan + ${project.version} + + + xalan + xalansamples + ${project.version} + + + + + xalan + xalan2jtaglet + ${project.version} + + + xalan + xalan2jtaglet_jdk9 + ${project.version} + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-jupiter.version} + test + + + org.junit.jupiter + junit-jupiter-params + ${junit-jupiter.version} + test + + + org.mockito + mockito-inline + ${mockito.version} + test + + + org.mockito + mockito-junit-jupiter + ${mockito.version} + test + + + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + xalan2jtaglet + + + + + aggregate + false + + aggregate + + + + default + + javadoc + + + + + + + + diff --git a/samples/CompiledBrazil/README.brazil b/samples/CompiledBrazil/README.brazil deleted file mode 100644 index ee5fe58f8..000000000 --- a/samples/CompiledBrazil/README.brazil +++ /dev/null @@ -1,55 +0,0 @@ -============================================================ -CONTENTS OF THIS DOCUMENT: - - o) HOW TO PROVIDE XSL TRANSFORMATIONS AS A WEB SERVICE - o) HOW TO INVOKE TRANSLETS FROM A BRAZIL HANDLER - ------------------------------------------------------------- -HOW TO PROVIDE XSL TRANSFORMATIONS AS A WEB SERVICE - -This sample code illustrates how Xalan/XSLTC can be used to -offer XSL transformations as a web service without using a -full web server. We have chosen to use the Brazil prototype -for the web interface, available from Sunlabs: - http://www.sun.com/research/brazil/ -but we could easily have used some other web interface such -as Tomcat. The supplied Java code implements a Brazil -"handler", which very much resembles a servlet. - -The CompiledEJB and CompiledServlet sample code -demonstrate other approaches to providing XSL transformations -as a web service. - ------------------------------------------------------------- -HOW TO INVOKE TRANSLETS FROM A BRAZIL HANDLER - -The CompiledBrazil directory contains the example source code: - - TransformHandler.java - -This file contains a minimal implementation of an XSL -transformation handler. You can find a precompiled version -in xsltcbrazil.jar. - -Compile any stylesheets you're interested in into translets. -Set your CLASSPATH to include xalan.jar, xercesImpl.jar, -xml-apis.jar, your translet classes and the Brazil server -jar file. - -You can now set up the Brazil server to service requests by -using the following command: - -$ java -Djavax.xml.transform.TransformerFactory=org.apache.xalan.xsltc.trax.TransformerFactoryImpl \ - sunlabs.brazil.server.Main -port 8080 \ - -handler TransformHandler - -In a browser, you can enter a URI similar to the following: - - http://localhost:8080/?translet=myTrans&document=myDoc - -where "myTrans" is the URI of a stylesheet that you've -compiled into a translet and "myDoc" is URI of an XML document -you'd like to process using that stylesheet. The result of -the transformation will be displayed in your browser. ------------------------------------------------------------- -END OF README diff --git a/samples/extensions/sql/ext-connection/ExternalConnection.java b/samples/extensions/sql/ext-connection/ExternalConnection.java deleted file mode 100644 index 753e474f9..000000000 --- a/samples/extensions/sql/ext-connection/ExternalConnection.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* - * $Id$ - */ -// Imported TraX classes -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.Transformer; -import javax.xml.transform.stream.StreamSource; -import javax.xml.transform.stream.StreamResult; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerConfigurationException; - -import org.apache.xalan.lib.sql.DefaultConnectionPool; -import org.apache.xalan.lib.sql.ConnectionPoolManager; - - -// Imported java classes -import java.io.StringReader; -import java.io.FileOutputStream; -import java.io.FileNotFoundException; -import java.io.IOException; - -/** - * Use the TraX interface to perform a transformation in the simplest manner possible - * (3 statements). - */ -public class ExternalConnection -{ - public static void main(String[] args) - throws TransformerException, TransformerConfigurationException, - FileNotFoundException, IOException - { - - // Create a connection to the database server - // Up the connection pool count for testing - DefaultConnectionPool cp = new DefaultConnectionPool(); - cp.setDriver("org.apache.derby.jdbc.EmbeddedDriver"); - cp.setURL("jdbc:derby:sampleDB"); - //cp.setUser("sa"); - //cp.setPassword(""); - cp.setMinConnections(10); - cp.setPoolEnabled(true); - - // Now let's register our connection pool so we can use - // in a stylesheet - ConnectionPoolManager pm = new ConnectionPoolManager(); - pm.registerPool("extpool", cp); - - - // Use the static TransformerFactory.newInstance() method to instantiate - // a TransformerFactory. The javax.xml.transform.TransformerFactory - // system property setting determines the actual class to instantiate -- - // org.apache.xalan.transformer.TransformerImpl. - TransformerFactory tFactory = TransformerFactory.newInstance(); - - // Grab the Name of the Stylesheet from the command line - if (args.length == 0) - { - System.out.println("You must provide the path and name to a stylesheet to process"); - System.exit(0); - } - - String stylesheet = args[0]; - System.out.println("Transforming Stylesheet " + stylesheet); - - // Use the TransformerFactory to instantiate a Transformer that will work with - // the stylesheet you specify. This method call also processes the stylesheet - // into a compiled Templates object. - Transformer transformer = tFactory.newTransformer( - new StreamSource(stylesheet)); - - // For this transformation, all the required information is in the stylesheet, so generate - // a minimal XML source document for the input. - // Note: the command-line processor (org.apache.xalan.xslt.Process) uses this strategy when - // the user does not provide an -IN parameter. - StringReader reader = - new StringReader(" "); - - // Use the Transformer to apply the associated Templates object to an XML document - // and write the output to a file. - transformer.transform( - new StreamSource(reader), - new StreamResult(new FileOutputStream("dbtest-out.html"))); - - System.out.println("************* The result is in dbtest-out.html *************"); - - cp.setPoolEnabled(false); - } -} diff --git a/samples/servlet/media.properties b/samples/servlet/media.properties deleted file mode 100644 index 45db095f4..000000000 --- a/samples/servlet/media.properties +++ /dev/null @@ -1,60 +0,0 @@ -## -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -## -# -# $Id$ -# -# This property file is used by com.lotus.xsl.server.DefaultApplyXSL. -# -# Each line below specifies a mapping rule between a value contained in the HTTP request's user-Agent -# field and a value to be scanned for in XSL stylesheet(s) associated with the XML data. This mapping -# enables relationships to be defined between client capabilities and stylesheets capable of acting -# on these capabilities. -# -# The rules defined below are order-significant. In other words, if the first rule is unsuccessful, -# the second rule will be tried, etc. The media value "unknown" will be used when no rules are -# satisfied. -# -# Example: -# -# Mapping rules of... -# -# MSIE=explorer -# MSPIE=pocketexplorer -# -# ...and XML data that contains XSL stylesheet associations of... -# -# -# -# -# ...and an HTTP request that contains a user-Agent value of... -# -# foo MSPIE bar -# -# ...will apply the XSL stylesheet somedata.xsl. -# -MSIE=explorer -MSPIE=pocketexplorer -HandHTTP=handweb -Mozilla=netscape -Lynx=lynx -Opera=opera -Java=java -AvantGo=avantgo -Nokia=nokia -UP.Browser=up -DoCoMo=imode diff --git a/serializer/pom.xml b/serializer/pom.xml new file mode 100644 index 000000000..13d420f44 --- /dev/null +++ b/serializer/pom.xml @@ -0,0 +1,153 @@ + + 4.0.0 + + xalan + xalan-j + 2.7.3 + + + serializer + Apache XML Serializer + Apache's XML serialization layer, as used in the Xalan XSLT processor + + + + + xalan + ${xalan.taglet.artifactId} + provided + + + + + org.apache.bcel + bcel + 6.7.0 + + + + commons-logging + commons-logging + 1.2 + provided + + + + javax + javaee-api + 6.0 + provided + + + + javax.servlet + servlet-api + 2.5 + provided + + + + xerces + xercesImpl + 2.12.2 + provided + + + + xml-apis + xml-apis + 1.4.01 + + provided + + + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.jupiter + junit-jupiter-params + test + + + org.mockito + mockito-inline + test + + + org.mockito + mockito-junit-jupiter + test + + + + + + + + + src/main/resources + true + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + + org.apache.maven.plugins + maven-dependency-plugin + + + + + + + + create-javadocs + + + [1,) + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + + create-sources + + + [1,) + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + + + diff --git a/src/MANIFEST.SERIALIZER b/serializer/src/main/java/MANIFEST.SERIALIZER similarity index 100% rename from src/MANIFEST.SERIALIZER rename to serializer/src/main/java/MANIFEST.SERIALIZER diff --git a/src/org/apache/xml/serializer/AttributesImplSerializer.java b/serializer/src/main/java/org/apache/xml/serializer/AttributesImplSerializer.java similarity index 100% rename from src/org/apache/xml/serializer/AttributesImplSerializer.java rename to serializer/src/main/java/org/apache/xml/serializer/AttributesImplSerializer.java diff --git a/src/org/apache/xml/serializer/CharInfo.java b/serializer/src/main/java/org/apache/xml/serializer/CharInfo.java similarity index 100% rename from src/org/apache/xml/serializer/CharInfo.java rename to serializer/src/main/java/org/apache/xml/serializer/CharInfo.java diff --git a/src/org/apache/xml/serializer/DOM3Serializer.java b/serializer/src/main/java/org/apache/xml/serializer/DOM3Serializer.java similarity index 98% rename from src/org/apache/xml/serializer/DOM3Serializer.java rename to serializer/src/main/java/org/apache/xml/serializer/DOM3Serializer.java index 82e6470da..d05c37743 100644 --- a/src/org/apache/xml/serializer/DOM3Serializer.java +++ b/serializer/src/main/java/org/apache/xml/serializer/DOM3Serializer.java @@ -45,7 +45,7 @@ *

* Example: *

- *    public class TestDOM3 {
+ *    public class TestDOM3 { 
  *
  *    public static void main(String args[]) throws Exception {
  *        // Get document to serialize
@@ -55,7 +55,8 @@
  *        System.out.println(test.testDOM3LS());
  *    }
  *
- *    public org.w3c.dom.Document getDocument() throws Exception {
+ *    // Javadoc needs an @code hint or it complains about angle brackets
+ *    public org.w3c.dom.Document getDocument() throws Exception {@code
  *        // Create a simple DOM Document.
  *        javax.xml.parsers.DocumentBuilderFactory factory = 
  *            javax.xml.parsers.DocumentBuilderFactory.newInstance();
diff --git a/src/org/apache/xml/serializer/DOMSerializer.java b/serializer/src/main/java/org/apache/xml/serializer/DOMSerializer.java
similarity index 100%
rename from src/org/apache/xml/serializer/DOMSerializer.java
rename to serializer/src/main/java/org/apache/xml/serializer/DOMSerializer.java
diff --git a/src/org/apache/xml/serializer/ElemContext.java b/serializer/src/main/java/org/apache/xml/serializer/ElemContext.java
similarity index 100%
rename from src/org/apache/xml/serializer/ElemContext.java
rename to serializer/src/main/java/org/apache/xml/serializer/ElemContext.java
diff --git a/src/org/apache/xml/serializer/ElemDesc.java b/serializer/src/main/java/org/apache/xml/serializer/ElemDesc.java
similarity index 100%
rename from src/org/apache/xml/serializer/ElemDesc.java
rename to serializer/src/main/java/org/apache/xml/serializer/ElemDesc.java
diff --git a/src/org/apache/xml/serializer/EmptySerializer.java b/serializer/src/main/java/org/apache/xml/serializer/EmptySerializer.java
similarity index 91%
rename from src/org/apache/xml/serializer/EmptySerializer.java
rename to serializer/src/main/java/org/apache/xml/serializer/EmptySerializer.java
index fba7de2cc..3bcd49ddd 100644
--- a/src/org/apache/xml/serializer/EmptySerializer.java
+++ b/serializer/src/main/java/org/apache/xml/serializer/EmptySerializer.java
@@ -50,43 +50,66 @@ public class EmptySerializer implements SerializationHandler
 {
     protected static final String ERR = "EmptySerializer method not over-ridden";
     /**
-     * @see SerializationHandler#asContentHandler()
+     * Architectural placeholder, overridden in derived classes
+     * @throws IOException if one arises in override implementation.
      */
-    
     protected void couldThrowIOException() throws IOException
     {
         return; // don't do anything.
     }
     
+    /**
+     * Architectural placeholder, overridden in derived classes
+     * @throws SAXException if one arises in override implementation.
+     */
     protected void couldThrowSAXException() throws SAXException
     {
         return; // don't do anything.
     }
     
+    /**
+     * Architectural placeholder, overridden in derived classes
+     * @param chars char[] containing content being serialized
+     * @param off integer offset into chars, start of content under consideration
+     * @param len integer character count, length of content under consideration
+     * @throws SAXException if one arises in override implementation.
+     */
     protected void couldThrowSAXException(char[] chars, int off, int len) throws SAXException
     {
         return; // don't do anything.
     }
     
+    /**
+     * Architectural placeholder, overridden in derived classes
+     * @param elemQName qualified name of element being serialized
+     * @throws SAXException if one arises in override implementation.
+     */
     protected void couldThrowSAXException(String elemQName) throws SAXException
     {
         return; // don't do anything.
     }
     
+    /**
+     * Architectural placeholder, overridden in derived classes
+     * @throws Exception (unknown which type) if one arises in override implementation.
+     */
     protected void couldThrowException() throws Exception
     {
         return; // don't do anything.
     }
 
+    /**
+     * Architectural placeholder, overridden in derived implementation.
+     * A handler method might be invoked, or inlined, from this location.
+     */
     void aMethodIsCalled()
     {
 
         // throw new RuntimeException(err);
         return;
     }
-  
     
-    /**
+    /** 
      * @see SerializationHandler#asContentHandler()
      */
     public ContentHandler asContentHandler() throws IOException
@@ -94,14 +117,14 @@ public ContentHandler asContentHandler() throws IOException
         couldThrowIOException();
         return null;
     }
-    /**
+    /** 
      * @see SerializationHandler#setContentHandler(org.xml.sax.ContentHandler)
      */
     public void setContentHandler(ContentHandler ch)
     {
         aMethodIsCalled();
     }
-    /**
+    /** 
      * @see SerializationHandler#close()
      */
     public void close()
@@ -109,6 +132,7 @@ public void close()
         aMethodIsCalled();
     }
     /**
+     * @return Properties object describing the serializer's configuration
      * @see SerializationHandler#getOutputFormat()
      */
     public Properties getOutputFormat()
@@ -117,6 +141,7 @@ public Properties getOutputFormat()
         return null;
     }
     /**
+     * @return the OutputStream that this serializer would write to
      * @see SerializationHandler#getOutputStream()
      */
     public OutputStream getOutputStream()
@@ -125,6 +150,7 @@ public OutputStream getOutputStream()
         return null;
     }
     /**
+     * @return the Writer this serializer uses to write to the OutputStream
      * @see SerializationHandler#getWriter()
      */
     public Writer getWriter()
@@ -133,6 +159,7 @@ public Writer getWriter()
         return null;
     }
     /**
+     * return 
      * @see SerializationHandler#reset()
      */
     public boolean reset()
@@ -155,6 +182,7 @@ public void setCdataSectionElements(Vector URI_and_localNames)
         aMethodIsCalled();
     }
     /**
+     * @return previous state of this flag, so it can be restored if desired.
      * @see SerializationHandler#setEscaping(boolean)
      */
     public boolean setEscaping(boolean escape) throws SAXException
@@ -217,7 +245,7 @@ public void setTransformer(Transformer transformer)
     public Transformer getTransformer()
     {
         aMethodIsCalled();
-        return null;
+	return null;
     }
     /**
      * @see SerializationHandler#flushPending()
@@ -559,7 +587,14 @@ public String getVersion()
         return null;
     }
     /**
-     * @see XSLOutputAttributes#setCdataSectionElements
+    /**
+     * I believe this is intended to be a convenience front-end for the
+     * version which takes a Vector.
+     * @see #setCdataSectionElements(java.util.Vector)
+     * @param h Hashtable listing the element types (as opposed to datatypes)
+     * to be handled as CData.
+     * @throws Exception if the request can't be fulfilled (details
+     * depend on implementation)
      */
     public void setCdataSectionElements(Hashtable h) throws Exception
     {
diff --git a/src/org/apache/xml/serializer/EncodingInfo.java b/serializer/src/main/java/org/apache/xml/serializer/EncodingInfo.java
similarity index 96%
rename from src/org/apache/xml/serializer/EncodingInfo.java
rename to serializer/src/main/java/org/apache/xml/serializer/EncodingInfo.java
index 840405b2f..e3fc76705 100644
--- a/src/org/apache/xml/serializer/EncodingInfo.java
+++ b/serializer/src/main/java/org/apache/xml/serializer/EncodingInfo.java
@@ -42,9 +42,9 @@
  * m_last). It will handle a certain range of values
  * explicitly (m_explFirst to m_explLast).
  * If the unicode point is before that explicit range, that is it
- * is in the range m_first <= value < m_explFirst, then it will delegate to another EncodingInfo object for The root
+ * is in the range m_first <= value < m_explFirst, then it will delegate to another EncodingInfo object for The root
  * of such a tree, m_before.  Likewise for values in the range 
- * m_explLast < value <= m_last, but delgating to m_after
+ * m_explLast < value <= m_last, but delgating to m_after
  * 

* Actually figuring out if a code point is in the encoding is expensive. So the * purpose of this tree is to cache such determinations, and not to build the @@ -97,6 +97,7 @@ public final class EncodingInfo extends Object * This is not a public API. It returns true if the * char in question is in the encoding. * @param ch the char in question. + * @return true if the character is a member of the encoding's charset *

* This method is not a public API. * @xsl.usage internal @@ -118,6 +119,7 @@ public boolean isInEncoding(char ch) { * character formed by the high/low pair is in the encoding. * @param high a char that the a high char of a high/low surrogate pair. * @param low a char that is the low char of a high/low surrogate pair. + * @return true if the character is a member of the encoding's charset *

* This method is not a public API. * @xsl.usage internal @@ -167,23 +169,24 @@ public EncodingInfo(String name, String javaName, char highChar) */ private interface InEncoding { /** - * Returns true if the char is in the encoding + * @return true if the char is in the encoding */ public boolean isInEncoding(char ch); /** - * Returns true if the high/low surrogate pair forms + * @return true if the high/low surrogate pair forms * a character that is in the encoding. */ public boolean isInEncoding(char high, char low); } /** - * This class implements the + * This class implements the InEncoding interface */ private class EncodingImpl implements InEncoding { - - + /** + * @return true if the char is in the encoding + */ public boolean isInEncoding(char ch1) { final boolean ret; int codePoint = Encodings.toCodePoint(ch1); @@ -231,6 +234,10 @@ public boolean isInEncoding(char ch1) { return ret; } + /** + * @return true if the high/low surrogate pair forms + * a character that is in the encoding. + */ public boolean isInEncoding(char high, char low) { final boolean ret; int codePoint = Encodings.toCodePoint(high,low); @@ -551,6 +558,7 @@ else if (data[0] == '?' && ch != '?') * If the value returned is '\u0000' it means that every character must be tested * with an isInEncoding method {@link #isInEncoding(char)} or {@link #isInEncoding(char, char)} * for surrogate pairs. + * @return highest character in lowest group of characters handled by this encoding *

* This method is not a public API. * @xsl.usage internal diff --git a/src/org/apache/xml/serializer/Encodings.java b/serializer/src/main/java/org/apache/xml/serializer/Encodings.java similarity index 100% rename from src/org/apache/xml/serializer/Encodings.java rename to serializer/src/main/java/org/apache/xml/serializer/Encodings.java diff --git a/src/org/apache/xml/serializer/ExtendedContentHandler.java b/serializer/src/main/java/org/apache/xml/serializer/ExtendedContentHandler.java similarity index 90% rename from src/org/apache/xml/serializer/ExtendedContentHandler.java rename to serializer/src/main/java/org/apache/xml/serializer/ExtendedContentHandler.java index 8cf35d3ff..df3358eb0 100644 --- a/src/org/apache/xml/serializer/ExtendedContentHandler.java +++ b/serializer/src/main/java/org/apache/xml/serializer/ExtendedContentHandler.java @@ -54,7 +54,7 @@ public interface ExtendedContentHandler extends org.xml.sax.ContentHandler * @param type the attribute type typically character data (CDATA) * @param value the value of the attribute * @param XSLAttribute true if the added attribute is coming from an xsl:attribute element - * @throws SAXException + * @throws SAXException if attribute could not be written to output */ public void addAttribute( String uri, @@ -67,7 +67,7 @@ public void addAttribute( /** * Add attributes to the current element * @param atts the attributes to add. - * @throws SAXException + * @throws SAXException if attributes could not be written to output */ public void addAttributes(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException; @@ -75,8 +75,8 @@ public void addAttributes(org.xml.sax.Attributes atts) * Add an attribute to the current element. The namespace URI of the * attribute will be calculated from the prefix of qName. The local name * will be derived from qName and the type will be assumed to be "CDATA". - * @param qName - * @param value + * @param qName Qualified Name of the attribute to be added + * @param value String value of the attribute to be added */ public void addAttribute(String qName, String value); @@ -84,7 +84,7 @@ public void addAttributes(org.xml.sax.Attributes atts) * This method is used to notify of a character event, but passing the data * as a character String rather than the standard character array. * @param chars the character data - * @throws SAXException + * @throws SAXException if characters could not be written to output */ public void characters(String chars) throws SAXException; @@ -92,7 +92,7 @@ public void addAttributes(org.xml.sax.Attributes atts) * This method is used to notify of a character event, but passing the data * as a DOM Node rather than the standard character array. * @param node a DOM Node containing text. - * @throws SAXException + * @throws SAXException if characters could not be written to output */ public void characters(org.w3c.dom.Node node) throws org.xml.sax.SAXException; /** @@ -105,7 +105,7 @@ public void addAttributes(org.xml.sax.Attributes atts) * the localName from the qualified name and derive the namespaceURI from * its implementation. * @param elemName the fully qualified element name. - * @throws SAXException + * @throws SAXException if end tag could not be written to output */ public void endElement(String elemName) throws SAXException; @@ -119,8 +119,7 @@ public void addAttributes(org.xml.sax.Attributes atts) * @param uri the namespace URI of the element * @param localName the local name (without prefix) of the element * @param qName the qualified name of the element - * - * @throws SAXException + * @throws SAXException if start tag could not be written to output */ public void startElement(String uri, String localName, String qName) throws org.xml.sax.SAXException; @@ -128,9 +127,10 @@ public void startElement(String uri, String localName, String qName) /** * This method is used to notify of the start of an element * @param qName the fully qualified name of the element - * @throws SAXException + * @throws SAXException if start tag could not be written to output */ public void startElement(String qName) throws SAXException; + /** * This method is used to notify that a prefix mapping is to start, but * after an element is started. The SAX method call @@ -147,7 +147,7 @@ public void startElement(String uri, String localName, String qName) * * @param uri the namespace URI being declared * @param prefix the prefix that maps to the given namespace - * @throws SAXException + * @throws SAXException if namespace declaration could not be processed */ public void namespaceAfterStartElement(String uri, String prefix) throws SAXException; @@ -163,7 +163,7 @@ public void namespaceAfterStartElement(String uri, String prefix) * @return boolean false if the prefix mapping was already in effect (in * other words we are just re-declaring), true if this is a new, never * before seen mapping for the element. - * @throws SAXException + * @throws SAXException if namespace declaration could not be processed */ public boolean startPrefixMapping( String prefix, @@ -173,7 +173,7 @@ public boolean startPrefixMapping( /** * Notify of an entity reference. * @param entityName the name of the entity - * @throws SAXException + * @throws SAXException if entity reference could not be written to output */ public void entityReference(String entityName) throws SAXException; @@ -239,6 +239,7 @@ public boolean startPrefixMapping( * @param qName the fully qualified attribute name. * @param value the attribute value * @param flags a bitwise flag + * @throws SAXException if attribute could not be added to output */ public void addUniqueAttribute(String qName, String value, int flags) throws SAXException; @@ -259,7 +260,7 @@ public void addUniqueAttribute(String qName, String value, int flags) * @param rawName the qualified name of the attribute * @param type the attribute type typically character data (CDATA) * @param value the value of the attribute - * @throws SAXException + * @throws SAXException if attribute could not be added to output */ public void addAttribute( String uri, diff --git a/src/org/apache/xml/serializer/ExtendedLexicalHandler.java b/serializer/src/main/java/org/apache/xml/serializer/ExtendedLexicalHandler.java similarity index 95% rename from src/org/apache/xml/serializer/ExtendedLexicalHandler.java rename to serializer/src/main/java/org/apache/xml/serializer/ExtendedLexicalHandler.java index bb7f90f53..837e32485 100644 --- a/src/org/apache/xml/serializer/ExtendedLexicalHandler.java +++ b/serializer/src/main/java/org/apache/xml/serializer/ExtendedLexicalHandler.java @@ -33,7 +33,7 @@ public interface ExtendedLexicalHandler extends org.xml.sax.ext.LexicalHandler * This method is used to notify of a comment * @param comment the comment, but unlike the SAX comment() method this * method takes a String rather than a character array. - * @throws SAXException + * @throws SAXException if comment could not be processed */ public void comment(String comment) throws SAXException; } diff --git a/src/org/apache/xml/serializer/Method.java b/serializer/src/main/java/org/apache/xml/serializer/Method.java similarity index 100% rename from src/org/apache/xml/serializer/Method.java rename to serializer/src/main/java/org/apache/xml/serializer/Method.java diff --git a/src/org/apache/xml/serializer/NamespaceMappings.java b/serializer/src/main/java/org/apache/xml/serializer/NamespaceMappings.java similarity index 96% rename from src/org/apache/xml/serializer/NamespaceMappings.java rename to serializer/src/main/java/org/apache/xml/serializer/NamespaceMappings.java index 91d25d342..0497c8656 100644 --- a/src/org/apache/xml/serializer/NamespaceMappings.java +++ b/serializer/src/main/java/org/apache/xml/serializer/NamespaceMappings.java @@ -33,22 +33,22 @@ * *

For example: *

- * 
- *   
- *      
- *      
- *    
- *    
- *    
- * 
+ * <chapter xmlns:p1="def">
+ *   <paragraph xmlns:p2="ghi">
+ *      <sentence xmlns:p3="jkl">
+ *      </sentence>
+ *    </paragraph>
+ *    <paragraph xlmns:p4="mno">
+ *    </paragraph>
+ * </chapter>
  * 
* - * When the element is encounted the prefix "p1" associated with uri + * When the <chapter> element is encounted the prefix "p1" associated with uri * "def" is pushed on the stack with depth 1. - * When the first is encountered "p2" and "ghi" are pushed with + * When the first <paragraph> is encountered "p2" and "ghi" are pushed with * depth 2. - * When the is encountered "p3" and "jkl" are pushed with depth 3. - * When occurs the popNamespaces(3) will pop "p3"/"jkl" off the + * When the <sentence> is encountered "p3" and "jkl" are pushed with depth 3. + * When </sentence> occurs the popNamespaces(3) will pop "p3"/"jkl" off the * stack. Of course popNamespaces(2) would pop anything with depth 2 or * greater. * @@ -221,6 +221,7 @@ boolean popNamespace(String prefix) * @param prefix a String with the prefix for a qualified name * @param uri a String with the uri to which the prefix is to map * @param elemDepth the depth of current declaration + * @return true if binding succeeded, false otherwise */ public boolean pushNamespace(String prefix, String uri, int elemDepth) { diff --git a/src/org/apache/xml/serializer/ObjectFactory.java b/serializer/src/main/java/org/apache/xml/serializer/ObjectFactory.java similarity index 100% rename from src/org/apache/xml/serializer/ObjectFactory.java rename to serializer/src/main/java/org/apache/xml/serializer/ObjectFactory.java diff --git a/src/org/apache/xml/serializer/OutputPropertiesFactory.java b/serializer/src/main/java/org/apache/xml/serializer/OutputPropertiesFactory.java similarity index 100% rename from src/org/apache/xml/serializer/OutputPropertiesFactory.java rename to serializer/src/main/java/org/apache/xml/serializer/OutputPropertiesFactory.java diff --git a/src/org/apache/xml/serializer/OutputPropertyUtils.java b/serializer/src/main/java/org/apache/xml/serializer/OutputPropertyUtils.java similarity index 100% rename from src/org/apache/xml/serializer/OutputPropertyUtils.java rename to serializer/src/main/java/org/apache/xml/serializer/OutputPropertyUtils.java diff --git a/src/org/apache/xml/serializer/SecuritySupport.java b/serializer/src/main/java/org/apache/xml/serializer/SecuritySupport.java similarity index 100% rename from src/org/apache/xml/serializer/SecuritySupport.java rename to serializer/src/main/java/org/apache/xml/serializer/SecuritySupport.java diff --git a/src/org/apache/xml/serializer/SerializationHandler.java b/serializer/src/main/java/org/apache/xml/serializer/SerializationHandler.java similarity index 87% rename from src/org/apache/xml/serializer/SerializationHandler.java rename to serializer/src/main/java/org/apache/xml/serializer/SerializationHandler.java index fca975f3c..6e0c8fd09 100644 --- a/src/org/apache/xml/serializer/SerializationHandler.java +++ b/serializer/src/main/java/org/apache/xml/serializer/SerializationHandler.java @@ -54,7 +54,7 @@ public interface SerializationHandler /** * Set the SAX Content handler that the serializer sends its output to. This * method only applies to a ToSAXHandler, not to a ToStream serializer. - * + * @param ch the ContentHandler to recieve serializer's output * @see Serializer#asContentHandler() * @see ToSAXHandler */ @@ -67,7 +67,7 @@ public interface SerializationHandler * serialized. * * @param node the DOM node to be serialized. - * @throws IOException + * @throws IOException if the serializer encounters IO problems. */ public void serialize(Node node) throws IOException; /** @@ -75,9 +75,14 @@ public interface SerializationHandler * * Note that characters will * never, even if this option is set to 'true', be escaped within - * CDATA sections in output XML documents. + * CDATA sections in output XML documents. The only kind of escaping + * which takes place in that mode is when we are forced to end a + * CDATA section and begin a new one in order to split content that + * would otherwise include the CDATA end sequence. * * @param escape true if escaping is to be set on. + * @return prior state of this flag, to permit restoring it later. + * @throws SAXException if the request cannot be handled correctly */ public boolean setEscaping(boolean escape) throws SAXException; @@ -131,6 +136,8 @@ public interface SerializationHandler *

* For performance reasons this method should not be called * very often. + * @throws SAXException if one was produced in the course of + * flushing the buffers (eg disk full or connection lost). */ public void flushPending() throws SAXException; diff --git a/src/org/apache/xml/serializer/Serializer.java b/serializer/src/main/java/org/apache/xml/serializer/Serializer.java similarity index 98% rename from src/org/apache/xml/serializer/Serializer.java rename to serializer/src/main/java/org/apache/xml/serializer/Serializer.java index 933d1c6ef..19b249158 100644 --- a/src/org/apache/xml/serializer/Serializer.java +++ b/serializer/src/main/java/org/apache/xml/serializer/Serializer.java @@ -146,7 +146,7 @@ public interface Serializer { * "omit-xml-declaration", "standalone", doctype-public", * "doctype-system", "cdata-section-elements", "indent", "media-type". * These property keys and their values are described in the XSLT recommendation, - * see {@link XSLT 1.0 recommendation} + * <a href="http://www.w3.org/TR/1999/REC-xslt-19991116"> XSLT 1.0 recommendation</a> *

* The non-standard property keys supported are defined in {@link OutputPropertiesFactory}. * diff --git a/src/org/apache/xml/serializer/SerializerBase.java b/serializer/src/main/java/org/apache/xml/serializer/SerializerBase.java similarity index 96% rename from src/org/apache/xml/serializer/SerializerBase.java rename to serializer/src/main/java/org/apache/xml/serializer/SerializerBase.java index 1df30014e..c0c3585c0 100644 --- a/src/org/apache/xml/serializer/SerializerBase.java +++ b/serializer/src/main/java/org/apache/xml/serializer/SerializerBase.java @@ -91,6 +91,7 @@ public abstract class SerializerBase /** * To fire off the end element trace event * @param name Name of element + * @throws SAXException if the trace handler produces one */ protected void fireEndElem(String name) throws org.xml.sax.SAXException @@ -107,6 +108,7 @@ protected void fireEndElem(String name) * @param chars content of characters * @param start starting index of characters to output * @param length number of characters to output + * @throws SAXException if the trace handler produces one */ protected void fireCharEvent(char[] chars, int start, int length) throws org.xml.sax.SAXException @@ -123,7 +125,7 @@ protected void fireCharEvent(char[] chars, int start, int length) */ protected boolean m_needToCallStartDocument = true; - /** True if a trailing "]]>" still needs to be written to be + /** True if a trailing "]]>" still needs to be written to be * written out. Used to merge adjacent CDATA sections */ protected boolean m_cdataTagOpen = false; @@ -273,6 +275,8 @@ public void comment(String data) throws SAXException * TODO: This method is a HACK! We do not have access to the * XML file, it sometimes generates a NS prefix of the form "ns?" for * an attribute. + * @param qname Qualified name to be patched. + * @return Replacement qname */ protected String patchName(String qname) { @@ -563,7 +567,7 @@ public String getEncoding() /** * Sets the character encoding coming from the xsl:output encoding stylesheet attribute. - * @param m_encoding the character encoding + * @param encoding the character encoding */ public void setEncoding(String encoding) { @@ -895,8 +899,7 @@ public String getNamespaceURIFromPrefix(String prefix) * Entity reference event. * * @param name Name of entity - * - * @throws org.xml.sax.SAXException + * @throws org.xml.sax.SAXException if the serializer or tracer encounters an error. */ public void entityReference(String name) throws org.xml.sax.SAXException { @@ -943,7 +946,7 @@ public Transformer getTransformer() * This method gets the nodes value as a String and uses that String as if * it were an input character notification. * @param node the Node to serialize - * @throws org.xml.sax.SAXException + * @throws org.xml.sax.SAXException if the serializer or tracer encounters an error. */ public void characters(org.w3c.dom.Node node) throws org.xml.sax.SAXException @@ -988,6 +991,7 @@ public void warning(SAXParseException exc) throws SAXException /** * To fire off start entity trace event * @param name Name of entity + * @throws org.xml.sax.SAXException if the tracer encounters an error. */ protected void fireStartEntity(String name) throws org.xml.sax.SAXException @@ -1041,6 +1045,7 @@ private void flushMyWriter() * @param chars content of CDATA * @param start starting index of characters to output * @param length number of characters to output + * @throws org.xml.sax.SAXException if the serializer or tracer encounters an error. */ protected void fireCDATAEvent(char[] chars, int start, int length) throws org.xml.sax.SAXException @@ -1057,6 +1062,7 @@ protected void fireCDATAEvent(char[] chars, int start, int length) * @param chars content of comment * @param start starting index of comment to output * @param length number of characters to output + * @throws org.xml.sax.SAXException if the serializer or tracer encounters an error. */ protected void fireCommentEvent(char[] chars, int start, int length) throws org.xml.sax.SAXException @@ -1072,6 +1078,7 @@ protected void fireCommentEvent(char[] chars, int start, int length) /** * To fire off end entity trace event * @param name Name of entity + * @throws org.xml.sax.SAXException if the serializer or tracer encounters an error. */ public void fireEndEntity(String name) throws org.xml.sax.SAXException @@ -1083,6 +1090,7 @@ public void fireEndEntity(String name) /** * To fire off start document trace event + * @throws org.xml.sax.SAXException if the serializer or tracer encounters an error. */ protected void fireStartDoc() throws org.xml.sax.SAXException @@ -1097,6 +1105,7 @@ protected void fireStartDoc() /** * To fire off end document trace event + * @throws org.xml.sax.SAXException if the serializer or tracer encounters an error. */ protected void fireEndDoc() throws org.xml.sax.SAXException @@ -1113,6 +1122,7 @@ protected void fireEndDoc() * called just before the attributes are cleared. * * @param elemName the qualified name of the element + * @throws org.xml.sax.SAXException if the serializer or tracer encounters an error. * */ protected void fireStartElem(String elemName) @@ -1127,21 +1137,11 @@ protected void fireStartElem(String elemName) } - /** - * To fire off the end element event - * @param name Name of element - */ -// protected void fireEndElem(String name) -// throws org.xml.sax.SAXException -// { -// if (m_tracer != null) -// m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_ENDELEMENT,name, (Attributes)null); -// } - - /** * To fire off the PI trace event * @param name Name of PI + * @param data PI parameters (typically pseudoattributes) + * @throws org.xml.sax.SAXException if the serializer or tracer encounters an error. */ protected void fireEscapingEvent(String name, String data) throws org.xml.sax.SAXException @@ -1158,6 +1158,7 @@ protected void fireEscapingEvent(String name, String data) /** * To fire off the entity reference trace event * @param name Name of entity reference + * @throws org.xml.sax.SAXException if the serializer or tracer encounters an error. */ protected void fireEntityReference(String name) throws org.xml.sax.SAXException @@ -1180,8 +1181,6 @@ protected void fireEntityReference(String name) * * @throws org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. - * - * @throws org.xml.sax.SAXException */ public void startDocument() throws org.xml.sax.SAXException { @@ -1206,7 +1205,8 @@ public void startDocument() throws org.xml.sax.SAXException * called from an external caller, which in principle is just a matter of * style. * - * @throws SAXException + * @throws org.xml.sax.SAXException Any SAX exception, possibly + * wrapping another exception. */ protected void startDocumentInternal() throws org.xml.sax.SAXException { @@ -1443,10 +1443,9 @@ private void addCDATAElement(String uri, String localName) /** - * Return true if nothing has been sent to this result tree yet. + * @return true if nothing has been sent to this result tree yet. *

* This is not a public API. - * * @xsl.usage internal */ public boolean documentIsEmpty() { @@ -1455,9 +1454,9 @@ public boolean documentIsEmpty() { } /** - * Return true if the current element in m_elemContext + * @return true if the current element in m_elemContext * is a CDATA section. - * CDATA sections are specified in the attribute + * CDATA sections are specified in the <xsl:output> attribute * cdata-section-names or in the JAXP equivalent property. * In any case the format of the value of such a property is: *

@@ -1561,8 +1560,8 @@ public String getOutputProperty(String name) {
      * not the default value. If there is a default
      * value, but no non-default value this method
      * will return null.
-     * 

- * + * @param name Property name to be queried + * @return default value, or null if no default is defined */ public String getOutputPropertyNonDefault(String name ) { diff --git a/src/org/apache/xml/serializer/SerializerConstants.java b/serializer/src/main/java/org/apache/xml/serializer/SerializerConstants.java similarity index 91% rename from src/org/apache/xml/serializer/SerializerConstants.java rename to serializer/src/main/java/org/apache/xml/serializer/SerializerConstants.java index 41cb45605..49a06dbd5 100644 --- a/src/org/apache/xml/serializer/SerializerConstants.java +++ b/serializer/src/main/java/org/apache/xml/serializer/SerializerConstants.java @@ -27,13 +27,11 @@ interface SerializerConstants { - /** To insert ]]> in a CDATA section by ending the last CDATA section with - * ]] and starting the next CDATA section with > + /** Use to insert ]]< in a CDATA section context by ending the + * last CDATA section with ]] and starting the next CDATA section + * with < */ static final String CDATA_CONTINUE = "]]]]>"; - /** - * The constant "]]>" - */ static final String CDATA_DELIMITER_CLOSE = "]]>"; static final String CDATA_DELIMITER_OPEN = " - * The standard property keys supported are: "method", "version", "encoding", - * "omit-xml-declaration", "standalone", doctype-public", - * "doctype-system", "cdata-section-elements", "indent", "media-type". - * These property keys and their values are described in the XSLT recommendation, - * see {@link XSLT 1.0 recommendation} + *

The standard property keys supported are: "method", + * "version", "encoding", "omit-xml-declaration", "standalone", + * doctype-public", "doctype-system", "cdata-section-elements", + * "indent", "media-type". These property keys and their values are + * described in the XSLT 1.0 + * recommendation * *

* The value of the "cdata-section-elements" property key is a whitespace @@ -79,13 +81,13 @@ private SerializerFactory() { * an exception of some type will be thrown. * For a list of the output "method" key values see {@link Method}. * + * May thrown an Exception if the class for the serializer is not + * found, or is found but does not implement ContentHandler. + * * @param format The output format, minimally the "method" property must be set. * @return A suitable serializer. * @throws IllegalArgumentException if method is * null or an appropriate serializer can't be found - * @throws Exception if the class for the serializer is found but does not - * implement ContentHandler. - * @throws WrappedRuntimeException if an exception is thrown while trying to find serializer */ public static Serializer getSerializer(Properties format) { diff --git a/src/org/apache/xml/serializer/SerializerTrace.java b/serializer/src/main/java/org/apache/xml/serializer/SerializerTrace.java similarity index 100% rename from src/org/apache/xml/serializer/SerializerTrace.java rename to serializer/src/main/java/org/apache/xml/serializer/SerializerTrace.java diff --git a/src/org/apache/xml/serializer/SerializerTraceWriter.java b/serializer/src/main/java/org/apache/xml/serializer/SerializerTraceWriter.java similarity index 100% rename from src/org/apache/xml/serializer/SerializerTraceWriter.java rename to serializer/src/main/java/org/apache/xml/serializer/SerializerTraceWriter.java diff --git a/src/org/apache/xml/serializer/ToHTMLSAXHandler.java b/serializer/src/main/java/org/apache/xml/serializer/ToHTMLSAXHandler.java similarity index 97% rename from src/org/apache/xml/serializer/ToHTMLSAXHandler.java rename to serializer/src/main/java/org/apache/xml/serializer/ToHTMLSAXHandler.java index 12f8b6384..46017c97c 100644 --- a/src/org/apache/xml/serializer/ToHTMLSAXHandler.java +++ b/serializer/src/main/java/org/apache/xml/serializer/ToHTMLSAXHandler.java @@ -79,7 +79,6 @@ public OutputStream getOutputStream() } /** - * Returns null * @return null * @see Serializer#getWriter() */ @@ -90,14 +89,19 @@ public Writer getWriter() /** * Does nothing. - * + * @throws SAXException never + * @param n would normally be the number of columns to indent by */ public void indent(int n) throws SAXException { } /** - * Does nothing. + * Does nothing. NOTE: we *COULD* have functionality here that + * Did Something Appropriate, if we could agree on what that is. + * Convert to text? + * @throws IOException never + * @param node DOM node to be ignored * @see DOMSerializer#serialize(Node) */ public void serialize(Node node) throws IOException @@ -108,10 +112,9 @@ public void serialize(Node node) throws IOException /** * Turns special character escaping on/off. * - * * @param escape true if escaping is to be set on. - * * @see SerializationHandler#setEscaping(boolean) + * @throws SAXException never (I think), but signature requires it. */ public boolean setEscaping(boolean escape) throws SAXException { @@ -283,8 +286,6 @@ public void ignorableWhitespace(char[] ch, int start, int length) * none was supplied. * @throws org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. - * - * @throws org.xml.sax.SAXException * @see org.xml.sax.ContentHandler#processingInstruction(String, String) */ public void processingInstruction(String target, String data) @@ -335,9 +336,6 @@ public void skippedEntity(String arg0) throws SAXException * @see org.xml.sax.ContentHandler#startElement * @see org.xml.sax.ContentHandler#endElement * @see org.xml.sax.AttributeList - * - * @throws org.xml.sax.SAXException - * * @see org.xml.sax.ContentHandler#startElement(String, String, String, Attributes) */ public void startElement( @@ -419,10 +417,6 @@ public void startEntity(String arg0) throws SAXException * * @throws org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. - * - * @throws org.xml.sax.SAXException - * - * */ public void endDocument() throws SAXException { @@ -467,9 +461,7 @@ public void close() * Receive notification of character data. * * @param chars The string of characters to process. - * - * @throws org.xml.sax.SAXException - * + * @throws org.xml.sax.SAXException if buffering fails * @see ExtendedContentHandler#characters(String) */ public void characters(final String chars) throws SAXException @@ -599,7 +591,7 @@ public void endElement(String elementName) throws SAXException * @see #ignorableWhitespace * @see org.xml.sax.Locator * - * @throws org.xml.sax.SAXException + * @throws org.xml.sax.SAXException if the underlying saxHandler objects * * @see org.xml.sax.ContentHandler#characters(char[], int, int) */ diff --git a/src/org/apache/xml/serializer/ToHTMLStream.java b/serializer/src/main/java/org/apache/xml/serializer/ToHTMLStream.java similarity index 98% rename from src/org/apache/xml/serializer/ToHTMLStream.java rename to serializer/src/main/java/org/apache/xml/serializer/ToHTMLStream.java index 453fac601..38e4632fd 100644 --- a/src/org/apache/xml/serializer/ToHTMLStream.java +++ b/serializer/src/main/java/org/apache/xml/serializer/ToHTMLStream.java @@ -676,10 +676,7 @@ public ToHTMLStream() /** * Receive notification of the beginning of a document. * - * @throws org.xml.sax.SAXException Any SAX exception, possibly - * wrapping another exception. - * - * @throws org.xml.sax.SAXException + * @throws SAXException if underlying handler reports an error */ protected void startDocumentInternal() throws org.xml.sax.SAXException { @@ -744,10 +741,7 @@ private void outputDocTypeDecl(String name) throws SAXException { /** * Receive notification of the end of a document. * - * @throws org.xml.sax.SAXException Any SAX exception, possibly - * wrapping another exception. - * - * @throws org.xml.sax.SAXException + * @throws SAXException if underlying handler reports an error */ public final void endDocument() throws org.xml.sax.SAXException { @@ -773,9 +767,8 @@ public final void endDocument() throws org.xml.sax.SAXException /** * Receive notification of the beginning of an element. * - * - * @param namespaceURI - * @param localName + * @param namespaceURI Element namespace binding from qname + * @param localName Element's local name from qname * @param name The element type name. * @param atts The attributes attached to the element, if any. * @throws org.xml.sax.SAXException Any SAX exception, possibly @@ -917,10 +910,8 @@ else if ( /** * Receive notification of the end of an element. - * - * - * @param namespaceURI - * @param localName + * @param namespaceURI Element namespace binding from qname + * @param localName Element's local name from qname * @param name The element type name * @throws org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. @@ -1054,7 +1045,7 @@ else if (m_doIndent && (!m_inBlockElem || isBlockElement)) * @param elemDesc The description of the HTML element * that has this attribute. * - * @throws org.xml.sax.SAXException + * @throws IOException if output fails */ protected void processAttribute( java.io.Writer writer, @@ -1139,11 +1130,12 @@ private boolean isHHSign(String str) * Write the specified string after substituting non ASCII characters, * with %HH, where HH is the hex of the byte value. * + * @param writer The writer to write the processed output to. * @param string String to convert to XML format. * @param doURLEscaping True if we should try to encode as * per http://www.ietf.org/rfc/rfc2396.txt. * - * @throws org.xml.sax.SAXException if a bad surrogate pair is detected. + * @throws IOException (SAXException) if a bad surrogate pair is detected. */ public void writeAttrURI( final java.io.Writer writer, String string, boolean doURLEscaping) @@ -1381,7 +1373,7 @@ else if (cleanLength == 1) * @param string String to convert to XML format. * @param encoding CURRENTLY NOT IMPLEMENTED. * - * @throws org.xml.sax.SAXException + * @throws IOException (org.xml.sax.SAXException) */ public void writeAttrString( final java.io.Writer writer, String string, String encoding) @@ -1523,8 +1515,6 @@ else if (cleanLength == 1) * wrapping another exception. * @see #ignorableWhitespace * @see org.xml.sax.Locator - * - * @throws org.xml.sax.SAXException */ public final void characters(char chars[], int start, int length) throws org.xml.sax.SAXException @@ -1587,8 +1577,6 @@ public final void characters(char chars[], int start, int length) * wrapping another exception. * @see #ignorableWhitespace * @see org.xml.sax.Locator - * - * @throws org.xml.sax.SAXException */ public final void cdata(char ch[], int start, int length) throws org.xml.sax.SAXException @@ -1638,8 +1626,6 @@ public final void cdata(char ch[], int start, int length) * none was supplied. * @throws org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. - * - * @throws org.xml.sax.SAXException */ public void processingInstruction(String target, String data) throws org.xml.sax.SAXException @@ -1727,7 +1713,7 @@ else if (m_needToCallStartDocument) * * @param name non-null reference to entity name string. * - * @throws org.xml.sax.SAXException + * @throws SAXException if underlying handler reports an error */ public final void entityReference(String name) throws org.xml.sax.SAXException @@ -1762,7 +1748,7 @@ public final void endElement(String elemName) throws SAXException * @param nAttrs the number of attributes in m_attributes * to be processed * - * @throws org.xml.sax.SAXException + * @throws SAXException if underlying handler reports an error */ public void processAttributes(java.io.Writer writer, int nAttrs) throws IOException,SAXException @@ -1781,11 +1767,11 @@ public void processAttributes(java.io.Writer writer, int nAttrs) } /** - * For the enclosing elements starting tag write out out any attributes - * followed by ">". At this point we also mark if this element is - * a cdata-section-element. + * For the enclosing elements starting tag write out out any + * attributes followed by the > character. At this point we + * also mark if this element is a cdata-section-element. * - *@throws org.xml.sax.SAXException + *@throws SAXException if underlying handler reports an error */ protected void closeStartTag() throws SAXException { @@ -1866,7 +1852,7 @@ public void startDTD(String name, String publicId, String systemId) /** * Report the end of DTD declarations. - * @throws org.xml.sax.SAXException The application may raise an exception. + * @throws SAXException if underlying handler reports an error * @see #startDTD */ public void endDTD() throws org.xml.sax.SAXException diff --git a/src/org/apache/xml/serializer/ToSAXHandler.java b/serializer/src/main/java/org/apache/xml/serializer/ToSAXHandler.java similarity index 98% rename from src/org/apache/xml/serializer/ToSAXHandler.java rename to serializer/src/main/java/org/apache/xml/serializer/ToSAXHandler.java index 0373f1dd4..75d423de7 100644 --- a/src/org/apache/xml/serializer/ToSAXHandler.java +++ b/serializer/src/main/java/org/apache/xml/serializer/ToSAXHandler.java @@ -113,7 +113,7 @@ public void startDTD(String arg0, String arg1, String arg2) * * @param characters The string of characters to process. * - * @throws org.xml.sax.SAXException + * @throws SAXException if underlying handler reports an error * * @see ExtendedContentHandler#characters(String) */ @@ -179,13 +179,11 @@ protected void closeCDATA() throws SAXException * SAX method additional namespace or attribute information can occur before * or after this call, that is associated with this element. * - * @throws org.xml.sax.SAXException Any SAX exception, possibly - * wrapping another exception. * @see org.xml.sax.ContentHandler#startElement * @see org.xml.sax.ContentHandler#endElement * @see org.xml.sax.AttributeList * - * @throws org.xml.sax.SAXException + * @throws SAXException if underlying handler reports an error * * @see org.xml.sax.ContentHandler#startElement(String,String,String,Attributes) */ @@ -342,7 +340,7 @@ public void startElement(String qName) throws SAXException { * This method gets the node's value as a String and uses that String as if * it were an input character notification. * @param node the Node to serialize - * @throws org.xml.sax.SAXException + * @throws SAXException if underlying handler reports an error */ public void characters(org.w3c.dom.Node node) throws org.xml.sax.SAXException diff --git a/src/org/apache/xml/serializer/ToStream.java b/serializer/src/main/java/org/apache/xml/serializer/ToStream.java similarity index 98% rename from src/org/apache/xml/serializer/ToStream.java rename to serializer/src/main/java/org/apache/xml/serializer/ToStream.java index 1134eb7ee..6340f2416 100644 --- a/src/org/apache/xml/serializer/ToStream.java +++ b/serializer/src/main/java/org/apache/xml/serializer/ToStream.java @@ -141,7 +141,7 @@ abstract public class ToStream extends SerializerBase boolean m_shouldFlush = true; /** - * Add space before '/>' for XHTML. + * Add space before self-closing '/>' syntax for XHTML. */ protected boolean m_spaceBeforeClose = false; @@ -184,9 +184,9 @@ public ToStream() } /** - * This helper method to writes out "]]>" when closing a CDATA section. + * This helper method writes the syntax for closing a CDATA section. * - * @throws org.xml.sax.SAXException + * @throws org.xml.sax.SAXException if write fails */ protected void closeCDATA() throws org.xml.sax.SAXException { @@ -233,7 +233,7 @@ public void serialize(Node node) throws IOException /** * Flush the formatter's result stream. * - * @throws org.xml.sax.SAXException + * @throws org.xml.sax.SAXException if write fails */ protected final void flushWriter() throws org.xml.sax.SAXException { @@ -357,7 +357,7 @@ public void internalEntityDecl(String name, String value) * @param name non-null reference to document type name. * NEEDSDOC @param value * - * @throws org.xml.sax.SAXException + * @throws IOException if an error occurs during writing. */ void outputEntityDecl(String name, String value) throws IOException { @@ -373,11 +373,11 @@ void outputEntityDecl(String name, String value) throws IOException /** * Output a system-dependent line break. * - * @throws org.xml.sax.SAXException + * @throws IOException if an error occurs during writing. + */ protected final void outputLineSep() throws IOException { - m_writer.write(m_lineSep, 0, m_lineSepLen); } @@ -780,7 +780,7 @@ public boolean setEscaping(boolean escape) * * @param depth the indentation depth (element nesting depth) * - * @throws org.xml.sax.SAXException if an error occurs during writing. + * @throws IOException if an error occurs during writing. */ protected void indent(int depth) throws IOException { @@ -798,7 +798,7 @@ protected void indent(int depth) throws IOException /** * Indent at the current element nesting depth. - * @throws IOException + * @throws IOException if an error occurs while writing */ protected void indent() throws IOException { @@ -808,7 +808,7 @@ protected void indent() throws IOException * Prints n spaces. * @param n Number of spaces to print. * - * @throws org.xml.sax.SAXException if an error occurs when writing. + * @throws IOException if an error occurs while writing */ private void printSpace(int n) throws IOException { @@ -934,7 +934,8 @@ public void externalEntityDecl( } /** - * Tell if this character can be written without escaping. + * @return true iff this character can be written without escaping. + * @param ch character to be tested */ protected boolean escapingNotNeeded(char ch) { @@ -976,8 +977,7 @@ protected boolean escapingNotNeeded(char ch) * the surrogate pair if an entity reference with that value * was written out. * - * @throws IOException - * @throws org.xml.sax.SAXException if invalid UTF-16 surrogate detected. + * @throws IOException if invalid UTF-16 surrogate detected. */ protected int writeUTF16Surrogate(char c, char ch[], int i, int end) throws IOException @@ -1051,7 +1051,7 @@ protected int writeUTF16Surrogate(char c, char ch[], int i, int end) * * @return i+1 if the character was written, else i. * - * @throws java.io.IOException + * @throws java.io.IOException if error arose while writing */ int accumDefaultEntity( java.io.Writer writer, @@ -1100,8 +1100,8 @@ int accumDefaultEntity( * @param useSystemLineSeparator true if the operating systems * end-of-line separator should be output rather than a new-line character. * - * @throws IOException - * @throws org.xml.sax.SAXException + * @throws IOException if unable to write + * @throws org.xml.sax.SAXException never (I think), but signature expects it */ void writeNormalizedChars( char ch[], @@ -1203,7 +1203,7 @@ else if (Encodings.isHighUTF16Surrogate(c)) * * @see #startNonEscaping * - * @throws org.xml.sax.SAXException + * @throws org.xml.sax.SAXException never, but signature expects it */ public void endNonEscaping() throws org.xml.sax.SAXException { @@ -1218,7 +1218,7 @@ public void endNonEscaping() throws org.xml.sax.SAXException *

The contents of the un-escaping section will be delivered through the * regular characters event. * - * @throws org.xml.sax.SAXException + * @throws org.xml.sax.SAXException never, but signature expects it */ public void startNonEscaping() throws org.xml.sax.SAXException { @@ -1249,8 +1249,6 @@ public void startNonEscaping() throws org.xml.sax.SAXException * wrapping another exception. * @see #ignorableWhitespace * @see org.xml.sax.Locator - * - * @throws org.xml.sax.SAXException */ protected void cdata(char ch[], int start, final int length) throws org.xml.sax.SAXException @@ -1338,7 +1336,7 @@ private boolean isEscapingDisabled() * @param start The start position in the array. * @param length The number of characters to read from the array. * - * @throws org.xml.sax.SAXException + * @throws org.xml.sax.SAXException containing IOException, if one arises */ protected void charactersRaw(char ch[], int start, int length) throws org.xml.sax.SAXException @@ -1389,8 +1387,6 @@ protected void charactersRaw(char ch[], int start, int length) * wrapping another exception. * @see #ignorableWhitespace * @see org.xml.sax.Locator - * - * @throws org.xml.sax.SAXException */ public void characters(final char chars[], final int start, final int length) throws org.xml.sax.SAXException @@ -1701,6 +1697,7 @@ private static boolean isNELorLSEPCharacter(char ch) * @param fromTextNode true if the characters being processed are * from a text node, false if they are from an attribute value. * @return the index of the last character processed + * @throws IOException if an error occurs while writing */ private int processDirty( char[] chars, @@ -1747,7 +1744,7 @@ private int processDirty( * * @param s The string of characters to process. * - * @throws org.xml.sax.SAXException + * @throws org.xml.sax.SAXException if characters could not be handled */ public void characters(String s) throws org.xml.sax.SAXException { @@ -1777,7 +1774,7 @@ public void characters(String s) throws org.xml.sax.SAXException * @return i+1 if a character was written, i+2 if two characters * were written out, else return i. * - * @throws org.xml.sax.SAXException + * @throws IOException if an error occurs while writing */ private int accumDefaultEscape( Writer writer, @@ -1888,8 +1885,6 @@ else if ((!escapingNotNeeded(ch) || * @see org.xml.sax.ContentHandler#startElement * @see org.xml.sax.ContentHandler#endElement * @see org.xml.sax.AttributeList - * - * @throws org.xml.sax.SAXException */ public void startElement( String namespaceURI, @@ -1978,7 +1973,7 @@ else if (m_cdataTagOpen) * @see org.xml.sax.ContentHandler#endElement * @see org.xml.sax.AttributeList * - * @throws org.xml.sax.SAXException + * @throws org.xml.sax.SAXException if characters could not be handled */ public void startElement( String elementNamespaceURI, @@ -2055,8 +2050,8 @@ void outputDocTypeDecl(String name, boolean closeDecl) throws SAXException * @param nAttrs the number of attributes in m_attributes * to be processed * - * @throws java.io.IOException - * @throws org.xml.sax.SAXException + * @throws IOException if an error occurs while writing + * @throws org.xml.sax.SAXException never (I think) */ public void processAttributes(java.io.Writer writer, int nAttrs) throws IOException, SAXException { @@ -2081,13 +2076,14 @@ public void processAttributes(java.io.Writer writer, int nAttrs) throws IOExcept } /** - * Returns the specified string after substituting specials, + * Writes the specified string after substituting specials, * and UTF-16 surrogates for chracter references &#xnn. * + * @param writer to recieve processed string * @param string String to convert to XML format. * @param encoding CURRENTLY NOT IMPLEMENTED. * - * @throws java.io.IOException + * @throws IOException if an error occurs while writing */ public void writeAttrString( Writer writer, @@ -2197,8 +2193,6 @@ else if (m_encodingInfo.isInEncoding(ch)) { * @param name The element type name * @throws org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. - * - * @throws org.xml.sax.SAXException */ public void endElement(String namespaceURI, String localName, String name) throws org.xml.sax.SAXException @@ -2529,8 +2523,6 @@ public void endPrefixMapping(String prefix) throws org.xml.sax.SAXException * @throws org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. * @see #characters - * - * @throws org.xml.sax.SAXException */ public void ignorableWhitespace(char ch[], int start, int length) throws org.xml.sax.SAXException @@ -2602,9 +2594,9 @@ public void startEntity(String name) throws org.xml.sax.SAXException /** * For the enclosing elements starting tag write out - * out any attributes followed by ">" + * out any attributes followed by the > character. * - * @throws org.xml.sax.SAXException + * @throws org.xml.sax.SAXException if underlying writer encounters error */ protected void closeStartTag() throws SAXException { @@ -2841,10 +2833,11 @@ public void setCdataSectionElements(Vector URI_and_localNames) * Makes sure that the namespace URI for the given qualified attribute name * is declared. * @param ns the namespace URI + * @param localName the local name * @param rawName the qualified name * @return returns null if no action is taken, otherwise it returns the * prefix used in declaring the namespace. - * @throws SAXException + * @throws SAXException if attempt to write declaration failed */ protected String ensureAttributesNamespaceIsDeclared( String ns, @@ -3542,9 +3535,9 @@ public void unparsedEntityDecl(String name, String pubID, String sysID, String n } /** - * A private helper method to output the - * @throws SAXException - * @throws IOException + * A private helper method to output the DTD + * @throws SAXException never (I think) + * @throws IOException if an error occurs while writing */ private void DTDprolog() throws SAXException, IOException { final java.io.Writer writer = m_writer; diff --git a/src/org/apache/xml/serializer/ToTextSAXHandler.java b/serializer/src/main/java/org/apache/xml/serializer/ToTextSAXHandler.java similarity index 97% rename from src/org/apache/xml/serializer/ToTextSAXHandler.java rename to serializer/src/main/java/org/apache/xml/serializer/ToTextSAXHandler.java index 78c6ab08b..c203eb8ad 100644 --- a/src/org/apache/xml/serializer/ToTextSAXHandler.java +++ b/serializer/src/main/java/org/apache/xml/serializer/ToTextSAXHandler.java @@ -69,9 +69,7 @@ public ToTextSAXHandler(ContentHandler hdlr, LexicalHandler lex, String encoding super(hdlr, lex, encoding); } - /** - * From XSLTC - */ + // This constructor supports XSLTC public ToTextSAXHandler(ContentHandler handler, String encoding) { super(handler,encoding); @@ -120,9 +118,9 @@ public Writer getWriter() } /** - * Does nothing because - * the indent attribute is ignored for text output. - * + * Does nothing + * @param n the indent attribute, ignored for text output. + * @throws SAXException never, but the method signature requires it. */ public void indent(int n) throws SAXException { diff --git a/src/org/apache/xml/serializer/ToTextStream.java b/serializer/src/main/java/org/apache/xml/serializer/ToTextStream.java similarity index 98% rename from src/org/apache/xml/serializer/ToTextStream.java rename to serializer/src/main/java/org/apache/xml/serializer/ToTextStream.java index 312bc8b87..cf22d68a1 100644 --- a/src/org/apache/xml/serializer/ToTextStream.java +++ b/serializer/src/main/java/org/apache/xml/serializer/ToTextStream.java @@ -57,8 +57,6 @@ public ToTextStream() * * @throws org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. - * - * @throws org.xml.sax.SAXException */ protected void startDocumentInternal() throws org.xml.sax.SAXException { @@ -80,8 +78,6 @@ protected void startDocumentInternal() throws org.xml.sax.SAXException * * @throws org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. - * - * @throws org.xml.sax.SAXException */ public void endDocument() throws org.xml.sax.SAXException { @@ -120,8 +116,6 @@ public void endDocument() throws org.xml.sax.SAXException * wrapping another exception. * @see #endElement * @see org.xml.sax.AttributeList - * - * @throws org.xml.sax.SAXException */ public void startElement( String namespaceURI, String localName, String name, Attributes atts) @@ -157,8 +151,6 @@ public void startElement( * empty string if qualified names are not available. * @throws org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. - * - * @throws org.xml.sax.SAXException */ public void endElement(String namespaceURI, String localName, String name) throws org.xml.sax.SAXException @@ -264,8 +256,8 @@ public void charactersRaw(char ch[], int start, int length) * @param useLineSep true if the operating systems * end-of-line separator should be output rather than a new-line character. * - * @throws IOException - * @throws org.xml.sax.SAXException + * @throws IOException if the write fails + * @throws org.xml.sax.SAXException if processing fails in the handler layer */ void writeNormalizedChars( final char ch[], @@ -412,8 +404,6 @@ public void cdata(char ch[], int start, int length) * @throws org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. * @see #characters - * - * @throws org.xml.sax.SAXException */ public void ignorableWhitespace(char ch[], int start, int length) throws org.xml.sax.SAXException @@ -445,8 +435,6 @@ public void ignorableWhitespace(char ch[], int start, int length) * none was supplied. * @throws org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. - * - * @throws org.xml.sax.SAXException */ public void processingInstruction(String target, String data) throws org.xml.sax.SAXException @@ -504,7 +492,7 @@ public void comment(char ch[], int start, int length) * * @param name non-null reference to the name of the entity. * - * @throws org.xml.sax.SAXException + * @throws org.xml.sax.SAXException if processing fails in the handler layer */ public void entityReference(String name) throws org.xml.sax.SAXException { diff --git a/src/org/apache/xml/serializer/ToUnknownStream.java b/serializer/src/main/java/org/apache/xml/serializer/ToUnknownStream.java similarity index 99% rename from src/org/apache/xml/serializer/ToUnknownStream.java rename to serializer/src/main/java/org/apache/xml/serializer/ToUnknownStream.java index e7ed0e010..b4777772a 100644 --- a/src/org/apache/xml/serializer/ToUnknownStream.java +++ b/serializer/src/main/java/org/apache/xml/serializer/ToUnknownStream.java @@ -37,9 +37,9 @@ /** - *This class wraps another SerializationHandler. The wrapped object will either + * This class wraps another SerializationHandler. The wrapped object will either * handler XML or HTML, which is not known until a little later when the first XML - * tag is seen. If the first tag is then the wrapped object is an HTML + * tag is seen. If the first tag is <html> then the wrapped object is an HTML * handler, otherwise it is an XML handler. * * This class effectively caches the first few calls to it then passes them diff --git a/src/org/apache/xml/serializer/ToXMLSAXHandler.java b/serializer/src/main/java/org/apache/xml/serializer/ToXMLSAXHandler.java similarity index 97% rename from src/org/apache/xml/serializer/ToXMLSAXHandler.java rename to serializer/src/main/java/org/apache/xml/serializer/ToXMLSAXHandler.java index eb18c8a2f..a9b9cc4f5 100644 --- a/src/org/apache/xml/serializer/ToXMLSAXHandler.java +++ b/serializer/src/main/java/org/apache/xml/serializer/ToXMLSAXHandler.java @@ -83,14 +83,17 @@ public Writer getWriter() /** * Do nothing for SAX. + * @param n Indentation in character-columns, ignored here + * @throws SAXException never, but inheritance requires it. */ public void indent(int n) throws SAXException { } - /** + /** @param node A DOM node (which this implementation will ignore) * @see DOMSerializer#serialize(Node) + * @throws IOException never, but inheritance requires it. */ public void serialize(Node node) throws IOException { @@ -217,12 +220,11 @@ protected void closeStartTag() throws SAXException * unlike the this.endCDATA() method (from the LexicalHandler) interface, * this "internal" method will send the endCDATA() call to the wrapped * handler. - * */ public void closeCDATA() throws SAXException { - // Output closing bracket - "]]>" + // Output CDATA closing bracket - "]]>" if (m_lexHandler != null && m_cdataTagOpen) { m_lexHandler.endCDATA(); } @@ -491,7 +493,7 @@ public ToXMLSAXHandler( /** * Start an element in the output document. This might be an XML element - * (data type) or a CDATA section. + * (<elem>data</elem> type) or a CDATA section. */ public void startElement( String elementNamespaceURI, @@ -570,9 +572,11 @@ public void namespaceAfterStartElement( } /** - * - * @see org.xml.sax.ContentHandler#processingInstruction(String, String) * Send a processing instruction to the output document + * @param target "name" of processing instruction + * @param data "value" of processing instruction + * @throws SAXException if underlying handler throws one + * @see org.xml.sax.ContentHandler#processingInstruction(String, String) */ public void processingInstruction(String target, String data) throws SAXException @@ -591,6 +595,8 @@ public void processingInstruction(String target, String data) /** * Undeclare the namespace that is currently pointed to by a given * prefix. Inform SAX handler if prefix was previously mapped. + * @param prefix Namespace prefix mapping to be removed + * @return true iff a mapping was present to be removed */ protected boolean popNamespace(String prefix) { diff --git a/src/org/apache/xml/serializer/ToXMLStream.java b/serializer/src/main/java/org/apache/xml/serializer/ToXMLStream.java similarity index 97% rename from src/org/apache/xml/serializer/ToXMLStream.java rename to serializer/src/main/java/org/apache/xml/serializer/ToXMLStream.java index e1ca8447b..da444c348 100644 --- a/src/org/apache/xml/serializer/ToXMLStream.java +++ b/serializer/src/main/java/org/apache/xml/serializer/ToXMLStream.java @@ -102,8 +102,6 @@ public void CopyFrom(ToXMLStream xmlListener) * * @throws org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. - * - * @throws org.xml.sax.SAXException */ public void startDocumentInternal() throws org.xml.sax.SAXException { @@ -178,8 +176,6 @@ public void startDocumentInternal() throws org.xml.sax.SAXException * * @throws org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. - * - * @throws org.xml.sax.SAXException */ public void endDocument() throws org.xml.sax.SAXException { @@ -212,7 +208,7 @@ public void endDocument() throws org.xml.sax.SAXException * The contents of the whitespace preserving section will be delivered * through the regular characters event. * - * @throws org.xml.sax.SAXException + * @throws org.xml.sax.SAXException never (I think) but required by signature */ public void startPreserving() throws org.xml.sax.SAXException { @@ -228,7 +224,7 @@ public void startPreserving() throws org.xml.sax.SAXException * * @see #startPreserving * - * @throws org.xml.sax.SAXException + * @throws org.xml.sax.SAXException never (I think), but required by signature. */ public void endPreserving() throws org.xml.sax.SAXException { @@ -245,8 +241,6 @@ public void endPreserving() throws org.xml.sax.SAXException * none was supplied. * @throws org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. - * - * @throws org.xml.sax.SAXException */ public void processingInstruction(String target, String data) throws org.xml.sax.SAXException @@ -339,7 +333,7 @@ else if (m_needToCallStartDocument) * * @param name The name of the entity. * - * @throws org.xml.sax.SAXException + * @throws org.xml.sax.SAXException never (I think), but required by signature. */ public void entityReference(String name) throws org.xml.sax.SAXException { @@ -418,14 +412,14 @@ public void addUniqueAttribute(String name, String value, int flags) /** * Add an attribute to the current element. - * @param uri the URI associated with the element name + * @param uri the URI associated with the attribute's namespace prefix * @param localName local part of the attribute name * @param rawName prefix:localName - * @param type + * @param type the attribute type typically character data (CDATA) * @param value the value of the attribute * @param xslAttribute true if this attribute is from an xsl:attribute, * false if declared within the elements opening tag. - * @throws SAXException + * @throws org.xml.sax.SAXException never (I think), but required by signature. */ public void addAttribute( String uri, @@ -553,6 +547,9 @@ public void namespaceAfterStartElement( * From XSLTC * Declare a prefix to point to a namespace URI. Inform SAX handler * if this is a new prefix mapping. + * @param prefix to be bound to namespace URI + * @param uri namespace identifier string + * @return true if prefix successfully bound, false otherwise. */ protected boolean pushNamespace(String prefix, String uri) { diff --git a/src/org/apache/xml/serializer/TransformStateSetter.java b/serializer/src/main/java/org/apache/xml/serializer/TransformStateSetter.java similarity index 91% rename from src/org/apache/xml/serializer/TransformStateSetter.java rename to serializer/src/main/java/org/apache/xml/serializer/TransformStateSetter.java index 0375773be..2f8dc9491 100644 --- a/src/org/apache/xml/serializer/TransformStateSetter.java +++ b/serializer/src/main/java/org/apache/xml/serializer/TransformStateSetter.java @@ -25,7 +25,7 @@ import org.w3c.dom.Node; /** * This interface is meant to be used by a base interface to - * TransformState, but which as only the setters which have non Xalan + * TransformState, but which has only the setters which have non Xalan * specific types in their signature, so that there are no dependancies * of the serializer on Xalan. * @@ -49,7 +49,7 @@ public interface TransformStateSetter /** * Reset the state on the given transformer object. * - * @param transformer + * @param transformer The transformer to have its state reset */ void resetState(Transformer transformer); diff --git a/src/org/apache/xml/serializer/TreeWalker.java b/serializer/src/main/java/org/apache/xml/serializer/TreeWalker.java similarity index 96% rename from src/org/apache/xml/serializer/TreeWalker.java rename to serializer/src/main/java/org/apache/xml/serializer/TreeWalker.java index 756a5da4f..fd3e225f1 100644 --- a/src/org/apache/xml/serializer/TreeWalker.java +++ b/serializer/src/main/java/org/apache/xml/serializer/TreeWalker.java @@ -24,6 +24,7 @@ import org.apache.xml.serializer.utils.AttList; import org.apache.xml.serializer.utils.DOM2Helper; +import org.apache.xml.serializer.utils.WrappedRuntimeException; import org.w3c.dom.Comment; import org.w3c.dom.Element; import org.w3c.dom.EntityReference; @@ -33,6 +34,7 @@ import org.w3c.dom.Text; import org.xml.sax.ContentHandler; import org.xml.sax.Locator; +import org.xml.sax.SAXException; import org.xml.sax.ext.LexicalHandler; import org.xml.sax.helpers.LocatorImpl; @@ -84,6 +86,8 @@ public TreeWalker(ContentHandler ch) { * Constructor. * @param contentHandler The implemention of the * contentHandler operation (toXMLString, digest, ...) + * @param systemId to be set into the output document. If null we + * use a default (currently dummy.xsl) */ public TreeWalker(ContentHandler contentHandler, String systemId) { @@ -131,7 +135,7 @@ public TreeWalker(ContentHandler contentHandler, String systemId) * * @param pos Node in the tree where to start traversal * - * @throws TransformerException + * @throws SAXException if the ContentHandler objects to the request. */ public void traverse(Node pos) throws org.xml.sax.SAXException { @@ -187,7 +191,7 @@ public void traverse(Node pos) throws org.xml.sax.SAXException * @param pos Node in the tree where to start traversal * @param top Node in the tree where to end traversal * - * @throws TransformerException + * @throws SAXException if the ContentHandler objects to the request. */ public void traverse(Node pos, Node top) throws org.xml.sax.SAXException { @@ -232,6 +236,7 @@ public void traverse(Node pos, Node top) throws org.xml.sax.SAXException /** * Optimized dispatch of characters. + * @throws SAXException if the ContentHandler objects to the request. */ private final void dispatachChars(Node node) throws org.xml.sax.SAXException @@ -252,8 +257,7 @@ private final void dispatachChars(Node node) * * * @param node Node to process - * - * @throws org.xml.sax.SAXException + * @throws SAXException if the ContentHandler objects to the request. */ protected void startNode(Node node) throws org.xml.sax.SAXException { @@ -428,7 +432,6 @@ else if (colon > 0) { } else { - // warning("Can not output entity to a pure SAX ContentHandler"); } } @@ -443,7 +446,7 @@ else if (colon > 0) { * * @param node Node we just finished processing * - * @throws org.xml.sax.SAXException + * @throws SAXException if the ContentHandler objects to the request. */ protected void endNode(Node node) throws org.xml.sax.SAXException { diff --git a/serializer/src/main/java/org/apache/xml/serializer/Version.java b/serializer/src/main/java/org/apache/xml/serializer/Version.java new file mode 100644 index 000000000..a57bbd8d7 --- /dev/null +++ b/serializer/src/main/java/org/apache/xml/serializer/Version.java @@ -0,0 +1,217 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * $Id$ + */ +package org.apache.xml.serializer; + +import java.io.InputStream; +import java.util.Properties; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Administrative class to keep track of the version number of + * the Serializer release. + *

This class implements the upcoming standard of having + * org.apache.project-name.Version.getVersion() be a standard way + * to get version information.

+ * @xsl.usage general + */ +public class Version { + private static final String VERSION_NUMBER_PATTERN = "^(\\d+)[.](\\d+)[.](D)?(\\d+)(-SNAPSHOT)?$"; + private static final String NO_VERSION = "0.0.0"; + + private static int majorVersionNum; + private static int releaseVersionNum; + private static int maintenanceVersionNum; + private static int developmentVersionNum; + + private static boolean snapshot; + + static { + parseVersionNumber(readVersionNumber()); + } + + static String readVersionNumber() { + try (InputStream fromResource = getPropertiesStream()) { + Properties properties = new Properties(); + if (fromResource != null) { + properties.load(fromResource); + return properties.getProperty("version", NO_VERSION); + } + } catch (Exception e) { + new RuntimeException("Cannot read properties file to extract Xalan version number information: ", e) + .printStackTrace(); + } + return NO_VERSION; + } + + static InputStream getPropertiesStream() { + // IMPLEMENTATION NOTE: Class.getResourceAsStream uses a *relative* path by + // default, in contrast to Classloader.getResourceAsStream, which uses an + // *absolute* one. This is not clearly documented in the JDK, only + // noticeable by the absence of the word "absolute" in + // Class.getResourceAsStream javadocs. For more details, see + // https://www.baeldung.com/java-class-vs-classloader-getresource. + // + // Because we expect the properties file to be in the same directory/package + // as this class, the relative path comes in handy and as a bonus is also + // relocation-friendly (think Maven Shade). + return Version.class.getResourceAsStream("version.properties"); + } + + static void parseVersionNumber(String version) { + resetVersionNumber(); + if (version == null) + version = NO_VERSION; + Matcher matcher = Pattern.compile(VERSION_NUMBER_PATTERN).matcher(version); + if (matcher.find()) { + majorVersionNum = Integer.parseInt(matcher.group(1)); + releaseVersionNum = Integer.parseInt(matcher.group(2)); + if (matcher.group(3) == null) { + maintenanceVersionNum = Integer.parseInt(matcher.group(4)); + } else { + developmentVersionNum = Integer.parseInt(matcher.group(4)); + } + snapshot = matcher.group(5) != null && !matcher.group(5).isEmpty(); + } else { + System.err.println( + "Cannot match Xalan version \"" + version + "\" " + + "against expected pattern \"" + VERSION_NUMBER_PATTERN + "\", " + + "resetting version number to "+ NO_VERSION + ); + resetVersionNumber(); + } + } + + private static void resetVersionNumber() { + majorVersionNum = releaseVersionNum = maintenanceVersionNum = developmentVersionNum = 0; + snapshot = false; + } + + /** + * Get the basic version string for the current Serializer release. + * Version String formatted like + * "Xalan Serializer Java v.r[.dd| Dnn]". + * + * @return String denoting our current version + */ + public static String getVersion() { + return getProduct()+" "+getImplementationLanguage()+" " + +getMajorVersionNum()+"."+getReleaseVersionNum()+"." + +( (getDevelopmentVersionNum() > 0) ? + ("D"+getDevelopmentVersionNum()) : (""+getMaintenanceVersionNum())) + +(isSnapshot() ? "-SNAPSHOT" :""); + } + + /** + * Print the processor version to the command line. + * + * @param argv command line arguments, unused. + */ + public static void main(String argv[]) { + System.out.println(getVersion()); + } + + /** + * Name of product: Xalan Serializer. + */ + public static String getProduct() { + return "Xalan Serializer"; + } + + /** + * Implementation Language: Java. + */ + public static String getImplementationLanguage() { + return "Java"; + } + + + /** + * Major version number. + * Version number. This changes only when there is a + * significant, externally apparent enhancement from + * the previous release. 'n' represents the n'th + * version. + *

+ * Clients should carefully consider the implications + * of new versions as external interfaces and behaviour + * may have changed. + */ + public static int getMajorVersionNum() { + return majorVersionNum; + } + + /** + * Release Number. + * Release number. This changes when: + * - a new set of functionality is to be added, eg, + * implementation of a new W3C specification. + * - API or behaviour change. + * - its designated as a reference release. + */ + public static int getReleaseVersionNum() { + return releaseVersionNum; + } + + /** + * Maintenance Drop Number. + * Optional identifier used to designate maintenance + * drop applied to a specific release and contains + * fixes for defects reported. It maintains compatibility + * with the release and contains no API changes. + * When missing, it designates the final and complete + * development drop for a release. + */ + public static int getMaintenanceVersionNum() { + return maintenanceVersionNum; + } + + /** + * Development Drop Number. + * Optional identifier designates development drop of + * a specific release. D01 is the first development drop + * of a new release. + *

+ * Development drops are works in progress towards a + * compeleted, final release. A specific development drop + * may not completely implement all aspects of a new + * feature, which may take several development drops to + * complete. At the point of the final drop for the + * release, the D suffix will be omitted. + *

+ * Each 'D' drops can contain functional enhancements as + * well as defect fixes. 'D' drops may not be as stable as + * the final releases. + */ + public static int getDevelopmentVersionNum() { + return developmentVersionNum; + } + + /** + * Snapshot flag. + * Specifies whether the version number has a "-SNAPSHOT" suffix, + * which by Maven/Gradle conventions designates a + * development version. + */ + public static boolean isSnapshot() { + return snapshot; + } +} diff --git a/src/org/apache/xml/serializer/WriterChain.java b/serializer/src/main/java/org/apache/xml/serializer/WriterChain.java similarity index 100% rename from src/org/apache/xml/serializer/WriterChain.java rename to serializer/src/main/java/org/apache/xml/serializer/WriterChain.java diff --git a/src/org/apache/xml/serializer/WriterToASCI.java b/serializer/src/main/java/org/apache/xml/serializer/WriterToASCI.java similarity index 100% rename from src/org/apache/xml/serializer/WriterToASCI.java rename to serializer/src/main/java/org/apache/xml/serializer/WriterToASCI.java diff --git a/src/org/apache/xml/serializer/WriterToUTF8Buffered.java b/serializer/src/main/java/org/apache/xml/serializer/WriterToUTF8Buffered.java similarity index 100% rename from src/org/apache/xml/serializer/WriterToUTF8Buffered.java rename to serializer/src/main/java/org/apache/xml/serializer/WriterToUTF8Buffered.java diff --git a/src/org/apache/xml/serializer/XSLOutputAttributes.java b/serializer/src/main/java/org/apache/xml/serializer/XSLOutputAttributes.java similarity index 97% rename from src/org/apache/xml/serializer/XSLOutputAttributes.java rename to serializer/src/main/java/org/apache/xml/serializer/XSLOutputAttributes.java index f5676f783..a285b154e 100644 --- a/src/org/apache/xml/serializer/XSLOutputAttributes.java +++ b/serializer/src/main/java/org/apache/xml/serializer/XSLOutputAttributes.java @@ -28,7 +28,7 @@ * * In an XSLT stylesheet these attributes appear for example as: *

- *  
+ * <xsl:output method="xml" omit-xml-declaration="no" indent="yes"/>
  * 
* The xsl:output attributes covered in this interface are: *
@@ -215,7 +215,7 @@ interface XSLOutputAttributes
      * 
  • "{http://xml.apache.org/xalan}indent-amount" *
  • "{http://xml.apache.org/xalan}line-separator" * - * @val The non-default value of the parameter + * @param val The non-default value of the parameter */ public void setOutputProperty(String name, String val); @@ -230,7 +230,7 @@ interface XSLOutputAttributes *
  • "{http://xml.apache.org/xalan}indent-amount" *
  • "{http://xml.apache.org/xalan}line-separator" * - * @val The default value of the parameter + * @param val The default value of the parameter */ public void setOutputPropertyDefault(String name, String val); } diff --git a/src/org/apache/xml/serializer/dom3/DOM3SerializerImpl.java b/serializer/src/main/java/org/apache/xml/serializer/dom3/DOM3SerializerImpl.java similarity index 97% rename from src/org/apache/xml/serializer/dom3/DOM3SerializerImpl.java rename to serializer/src/main/java/org/apache/xml/serializer/dom3/DOM3SerializerImpl.java index 3f765d9e6..e382ba5d7 100644 --- a/src/org/apache/xml/serializer/dom3/DOM3SerializerImpl.java +++ b/serializer/src/main/java/org/apache/xml/serializer/dom3/DOM3SerializerImpl.java @@ -87,7 +87,7 @@ public LSSerializerFilter getNodeFilter() { } /** - * Gets the end-of-line sequence of characters to be used during serialization. + * @return char[] containing the end-of-line sequence of characters to be used during serialization. */ public char[] getNewLine() { return (fNewLine != null) ? fNewLine.toCharArray() : null; diff --git a/src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java b/serializer/src/main/java/org/apache/xml/serializer/dom3/DOM3TreeWalker.java similarity index 100% rename from src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java rename to serializer/src/main/java/org/apache/xml/serializer/dom3/DOM3TreeWalker.java diff --git a/src/org/apache/xml/serializer/dom3/DOMConstants.java b/serializer/src/main/java/org/apache/xml/serializer/dom3/DOMConstants.java similarity index 100% rename from src/org/apache/xml/serializer/dom3/DOMConstants.java rename to serializer/src/main/java/org/apache/xml/serializer/dom3/DOMConstants.java diff --git a/src/org/apache/xml/serializer/dom3/DOMErrorHandlerImpl.java b/serializer/src/main/java/org/apache/xml/serializer/dom3/DOMErrorHandlerImpl.java similarity index 100% rename from src/org/apache/xml/serializer/dom3/DOMErrorHandlerImpl.java rename to serializer/src/main/java/org/apache/xml/serializer/dom3/DOMErrorHandlerImpl.java diff --git a/src/org/apache/xml/serializer/dom3/DOMErrorImpl.java b/serializer/src/main/java/org/apache/xml/serializer/dom3/DOMErrorImpl.java similarity index 100% rename from src/org/apache/xml/serializer/dom3/DOMErrorImpl.java rename to serializer/src/main/java/org/apache/xml/serializer/dom3/DOMErrorImpl.java diff --git a/src/org/apache/xml/serializer/dom3/DOMLocatorImpl.java b/serializer/src/main/java/org/apache/xml/serializer/dom3/DOMLocatorImpl.java similarity index 100% rename from src/org/apache/xml/serializer/dom3/DOMLocatorImpl.java rename to serializer/src/main/java/org/apache/xml/serializer/dom3/DOMLocatorImpl.java diff --git a/src/org/apache/xml/serializer/dom3/DOMOutputImpl.java b/serializer/src/main/java/org/apache/xml/serializer/dom3/DOMOutputImpl.java similarity index 100% rename from src/org/apache/xml/serializer/dom3/DOMOutputImpl.java rename to serializer/src/main/java/org/apache/xml/serializer/dom3/DOMOutputImpl.java diff --git a/src/org/apache/xml/serializer/dom3/DOMStringListImpl.java b/serializer/src/main/java/org/apache/xml/serializer/dom3/DOMStringListImpl.java similarity index 100% rename from src/org/apache/xml/serializer/dom3/DOMStringListImpl.java rename to serializer/src/main/java/org/apache/xml/serializer/dom3/DOMStringListImpl.java diff --git a/src/org/apache/xml/serializer/dom3/LSSerializerImpl.java b/serializer/src/main/java/org/apache/xml/serializer/dom3/LSSerializerImpl.java similarity index 99% rename from src/org/apache/xml/serializer/dom3/LSSerializerImpl.java rename to serializer/src/main/java/org/apache/xml/serializer/dom3/LSSerializerImpl.java index c2ce783e6..7ce20c3b6 100644 --- a/src/org/apache/xml/serializer/dom3/LSSerializerImpl.java +++ b/serializer/src/main/java/org/apache/xml/serializer/dom3/LSSerializerImpl.java @@ -1363,9 +1363,7 @@ public boolean writeToURI(Node nodeArg, String uri) throws LSException { * * @param nodeArg The Node to serialize * @return A String containing the version pseudo-attribute of the XMLDecl. - * @throws Throwable if the DOM implementation does not implement Document.getXmlVersion() */ - //protected String getXMLVersion(Node nodeArg) throws Throwable { protected String getXMLVersion(Node nodeArg) { Document doc = null; @@ -1393,10 +1391,10 @@ protected String getXMLVersion(Node nodeArg) { /** * Determines the XML Encoding of the Document Node to serialize. If the Document Node * is not a DOM Level 3 Node, then the default encoding "UTF-8" is returned. + * NOTE: May throw an unspecified Throwable if the DOM implementation does not implement Document.getXmlEncoding() * * @param nodeArg The Node to serialize * @return A String containing the encoding pseudo-attribute of the XMLDecl. - * @throws Throwable if the DOM implementation does not implement Document.getXmlEncoding() */ protected String getXMLEncoding(Node nodeArg) { Document doc = null; diff --git a/src/org/apache/xml/serializer/dom3/NamespaceSupport.java b/serializer/src/main/java/org/apache/xml/serializer/dom3/NamespaceSupport.java similarity index 79% rename from src/org/apache/xml/serializer/dom3/NamespaceSupport.java rename to serializer/src/main/java/org/apache/xml/serializer/dom3/NamespaceSupport.java index 445f3eb9d..a7eb6bffa 100644 --- a/src/org/apache/xml/serializer/dom3/NamespaceSupport.java +++ b/serializer/src/main/java/org/apache/xml/serializer/dom3/NamespaceSupport.java @@ -150,6 +150,9 @@ public void popContext() { } // popContext() /** + * @param prefix String containing the QName prefix to be bound + * @param uri String containing the namespace URI to bind to prefix + * @return false if binding the prefix is forbidden(xml: and xmlns:), otherwise true * @see org.apache.xerces.xni.NamespaceContext#declarePrefix(String, String) */ public boolean declarePrefix(String prefix, String uri) { @@ -189,6 +192,9 @@ public boolean declarePrefix(String prefix, String uri) { } // declarePrefix(String,String):boolean /** + * @param prefix String prefix to be looked up in this context + * @return String containing the Namespace URI bound to that prefix, + * or null if unbound * @see org.apache.xerces.xni.NamespaceContext#getURI(String) */ public String getURI(String prefix) { @@ -207,9 +213,13 @@ public String getURI(String prefix) { } // getURI(String):String - /** - * @see org.apache.xerces.xni.NamespaceContext#getPrefix(String) - */ + /** + * @param uri String containing the Namespace URI to be looked up + * @return String containing a prefix bound to that namespace + * or null if unbound. CAVEAT: There may be multiple prefixes bound + * to the same namespace; this returns the first found. + * @see org.apache.xerces.xni.NamespaceContext#getPrefix(String) + */ public String getPrefix(String uri) { // find uri in current context @@ -228,24 +238,28 @@ public String getPrefix(String uri) { } // getPrefix(String):String - /** - * @see org.apache.xerces.xni.NamespaceContext#getDeclaredPrefixCount() - */ + /** @return number of prefixes currently bound + * @see org.apache.xerces.xni.NamespaceContext#getDeclaredPrefixCount() + */ public int getDeclaredPrefixCount() { return (fNamespaceSize - fContext[fCurrentContext]) / 2; } // getDeclaredPrefixCount():int - /** - * @see org.apache.xerces.xni.NamespaceContext#getDeclaredPrefixAt(int) - */ + /** + * @param index Select prefix from all currently bound + * @return The prefix in that slot of our table. Equivalent to + * indexing into enumerator returned by #getAllPrefixes() + * @see org.apache.xerces.xni.NamespaceContext#getDeclaredPrefixAt(int) + */ public String getDeclaredPrefixAt(int index) { return fNamespace[fContext[fCurrentContext] + index * 2]; } // getDeclaredPrefixAt(int):String - - /** - * @see org.apache.xerces.xni.NamespaceContext#getAllPrefixes() - */ - public Enumeration getAllPrefixes() { + + /** + * @return an Enumeration of the namespace prefixes currently bound + * @see org.apache.xerces.xni.NamespaceContext#getAllPrefixes() + */ + public Enumeration getAllPrefixes() { int count = 0; if (fPrefixes.length < (fNamespace.length/2)) { // resize prefix array @@ -269,36 +283,43 @@ public Enumeration getAllPrefixes() { } return new Prefixes(fPrefixes, count); } - + + // I'm a bit confused by Prefixes.prefixes vs. NamespaceSupper.fPrefixes. + // Need to review the logic and document that. -- jkesselm GONK protected final class Prefixes implements Enumeration { private String[] prefixes; private int counter = 0; private int size = 0; - /** - * Constructor for Prefixes. - */ - public Prefixes(String [] prefixes, int size) { - this.prefixes = prefixes; + /** + * Constructor for Prefixes enumerator + * @param prefixes String[] Set of prefixes. + * @param size integer Number of preloaded prefixes + */ + public Prefixes(String [] prefixes, int size) { + this.prefixes = prefixes; this.size = size; - } - + } + /** - * @see java.util.Enumeration#hasMoreElements() - */ - public boolean hasMoreElements() { - return (counter< size); - } - - /** - * @see java.util.Enumeration#nextElement() - */ - public Object nextElement() { + * @return true if this object, as an Enumeration, can return + * more bindings + * @see java.util.Enumeration#hasMoreElements() + */ + public boolean hasMoreElements() { + return (counter< size); + } + + /** + * @return the next binding's prefix, as an Enumeration result + * @see java.util.Enumeration#nextElement() + */ + public Object nextElement() { if (counter< size){ return fPrefixes[counter++]; } - throw new NoSuchElementException("Illegal access to Namespace prefixes enumeration."); - } + throw new NoSuchElementException("Illegal access to Namespace prefixes enumeration."); + } public String toString(){ StringBuffer buf = new StringBuffer(); @@ -310,6 +331,6 @@ public String toString(){ return buf.toString(); } -} - + } + } // class NamespaceSupport diff --git a/src/org/apache/xml/serializer/package.html b/serializer/src/main/java/org/apache/xml/serializer/package.html similarity index 100% rename from src/org/apache/xml/serializer/package.html rename to serializer/src/main/java/org/apache/xml/serializer/package.html diff --git a/src/org/apache/xml/serializer/utils/AttList.java b/serializer/src/main/java/org/apache/xml/serializer/utils/AttList.java similarity index 100% rename from src/org/apache/xml/serializer/utils/AttList.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/AttList.java diff --git a/src/org/apache/xml/serializer/utils/BoolStack.java b/serializer/src/main/java/org/apache/xml/serializer/utils/BoolStack.java similarity index 99% rename from src/org/apache/xml/serializer/utils/BoolStack.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/BoolStack.java index 68cea4229..e1f49d6bc 100644 --- a/src/org/apache/xml/serializer/utils/BoolStack.java +++ b/serializer/src/main/java/org/apache/xml/serializer/utils/BoolStack.java @@ -19,7 +19,7 @@ * $Id$ */ package org.apache.xml.serializer.utils; - +import java.util.EmptyStackException; /** * Simple stack for boolean values. diff --git a/src/org/apache/xml/serializer/utils/DOM2Helper.java b/serializer/src/main/java/org/apache/xml/serializer/utils/DOM2Helper.java similarity index 100% rename from src/org/apache/xml/serializer/utils/DOM2Helper.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/DOM2Helper.java diff --git a/src/org/apache/xml/serializer/utils/Messages.java b/serializer/src/main/java/org/apache/xml/serializer/utils/Messages.java similarity index 100% rename from src/org/apache/xml/serializer/utils/Messages.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/Messages.java diff --git a/src/org/apache/xml/serializer/utils/MsgKey.java b/serializer/src/main/java/org/apache/xml/serializer/utils/MsgKey.java similarity index 100% rename from src/org/apache/xml/serializer/utils/MsgKey.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/MsgKey.java diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages.java b/serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages.java similarity index 100% rename from src/org/apache/xml/serializer/utils/SerializerMessages.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages.java diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_ca.java b/serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_ca.java similarity index 100% rename from src/org/apache/xml/serializer/utils/SerializerMessages_ca.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_ca.java diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_cs.java b/serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_cs.java similarity index 100% rename from src/org/apache/xml/serializer/utils/SerializerMessages_cs.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_cs.java diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_de.java b/serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_de.java similarity index 100% rename from src/org/apache/xml/serializer/utils/SerializerMessages_de.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_de.java diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_en.java b/serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_en.java similarity index 100% rename from src/org/apache/xml/serializer/utils/SerializerMessages_en.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_en.java diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_es.java b/serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_es.java similarity index 100% rename from src/org/apache/xml/serializer/utils/SerializerMessages_es.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_es.java diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_fr.java b/serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_fr.java similarity index 100% rename from src/org/apache/xml/serializer/utils/SerializerMessages_fr.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_fr.java diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_hu.java b/serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_hu.java similarity index 100% rename from src/org/apache/xml/serializer/utils/SerializerMessages_hu.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_hu.java diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_it.java b/serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_it.java similarity index 100% rename from src/org/apache/xml/serializer/utils/SerializerMessages_it.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_it.java diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_ja.java b/serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_ja.java similarity index 100% rename from src/org/apache/xml/serializer/utils/SerializerMessages_ja.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_ja.java diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_ko.java b/serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_ko.java similarity index 100% rename from src/org/apache/xml/serializer/utils/SerializerMessages_ko.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_ko.java diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_pl.java b/serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_pl.java similarity index 100% rename from src/org/apache/xml/serializer/utils/SerializerMessages_pl.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_pl.java diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_pt_BR.java b/serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_pt_BR.java similarity index 100% rename from src/org/apache/xml/serializer/utils/SerializerMessages_pt_BR.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_pt_BR.java diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_ru.java b/serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_ru.java similarity index 100% rename from src/org/apache/xml/serializer/utils/SerializerMessages_ru.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_ru.java diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_sk.java b/serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_sk.java similarity index 100% rename from src/org/apache/xml/serializer/utils/SerializerMessages_sk.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_sk.java diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_sl.java b/serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_sl.java similarity index 100% rename from src/org/apache/xml/serializer/utils/SerializerMessages_sl.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_sl.java diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_sv.java b/serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_sv.java similarity index 100% rename from src/org/apache/xml/serializer/utils/SerializerMessages_sv.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_sv.java diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_tr.java b/serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_tr.java similarity index 100% rename from src/org/apache/xml/serializer/utils/SerializerMessages_tr.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_tr.java diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_zh.java b/serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_zh.java similarity index 100% rename from src/org/apache/xml/serializer/utils/SerializerMessages_zh.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_zh.java diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_zh_CN.java b/serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_zh_CN.java similarity index 100% rename from src/org/apache/xml/serializer/utils/SerializerMessages_zh_CN.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_zh_CN.java diff --git a/src/org/apache/xml/serializer/utils/SerializerMessages_zh_TW.java b/serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_zh_TW.java similarity index 100% rename from src/org/apache/xml/serializer/utils/SerializerMessages_zh_TW.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_zh_TW.java diff --git a/src/org/apache/xml/serializer/utils/StringToIntTable.java b/serializer/src/main/java/org/apache/xml/serializer/utils/StringToIntTable.java similarity index 100% rename from src/org/apache/xml/serializer/utils/StringToIntTable.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/StringToIntTable.java diff --git a/src/org/apache/xml/serializer/utils/SystemIDResolver.java b/serializer/src/main/java/org/apache/xml/serializer/utils/SystemIDResolver.java similarity index 100% rename from src/org/apache/xml/serializer/utils/SystemIDResolver.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/SystemIDResolver.java diff --git a/src/org/apache/xml/serializer/utils/URI.java b/serializer/src/main/java/org/apache/xml/serializer/utils/URI.java similarity index 100% rename from src/org/apache/xml/serializer/utils/URI.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/URI.java diff --git a/src/org/apache/xml/serializer/utils/Utils.java b/serializer/src/main/java/org/apache/xml/serializer/utils/Utils.java similarity index 100% rename from src/org/apache/xml/serializer/utils/Utils.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/Utils.java diff --git a/src/org/apache/xml/serializer/utils/WrappedRuntimeException.java b/serializer/src/main/java/org/apache/xml/serializer/utils/WrappedRuntimeException.java similarity index 100% rename from src/org/apache/xml/serializer/utils/WrappedRuntimeException.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/WrappedRuntimeException.java diff --git a/src/org/apache/xml/serializer/utils/XML11Char.java b/serializer/src/main/java/org/apache/xml/serializer/utils/XML11Char.java similarity index 95% rename from src/org/apache/xml/serializer/utils/XML11Char.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/XML11Char.java index b32249ed5..f6756cc15 100644 --- a/src/org/apache/xml/serializer/utils/XML11Char.java +++ b/serializer/src/main/java/org/apache/xml/serializer/utils/XML11Char.java @@ -152,7 +152,7 @@ public class XML11Char { // /** - * Returns true if the specified character is a space character + * @return true if the specified character is a space character * as amdended in the XML 1.1 specification. * * @param c The character to check. @@ -162,7 +162,7 @@ public static boolean isXML11Space(int c) { } // isXML11Space(int):boolean /** - * Returns true if the specified character is valid. This method + * @return true if the specified character is valid. This method * also checks the surrogate character range from 0x10000 to 0x10FFFF. *

    * If the program chooses to apply the mask directly to the @@ -177,7 +177,7 @@ public static boolean isXML11Valid(int c) { } // isXML11Valid(int):boolean /** - * Returns true if the specified character is invalid. + * @return true if the specified character is invalid. * * @param c The character to check. */ @@ -186,7 +186,7 @@ public static boolean isXML11Invalid(int c) { } // isXML11Invalid(int):boolean /** - * Returns true if the specified character is valid and permitted outside + * @return true if the specified character is valid and permitted outside * of a character reference. * That is, this method will return false for the same set as * isXML11Valid, except it also reports false for "control characters". @@ -199,7 +199,7 @@ public static boolean isXML11ValidLiteral(int c) { } // isXML11ValidLiteral(int):boolean /** - * Returns true if the specified character can be considered + * @return true if the specified character can be considered * content in an external parsed entity. * * @param c The character to check. @@ -210,7 +210,7 @@ public static boolean isXML11Content(int c) { } // isXML11Content(int):boolean /** - * Returns true if the specified character can be considered + * @return true if the specified character can be considered * content in an internal parsed entity. * * @param c The character to check. @@ -221,7 +221,7 @@ public static boolean isXML11InternalEntityContent(int c) { } // isXML11InternalEntityContent(int):boolean /** - * Returns true if the specified character is a valid name start + * @return true if the specified character is a valid name start * character as defined by production [4] in the XML 1.1 * specification. * @@ -233,7 +233,7 @@ public static boolean isXML11NameStart(int c) { } // isXML11NameStart(int):boolean /** - * Returns true if the specified character is a valid name + * @return true if the specified character is a valid name * character as defined by production [4a] in the XML 1.1 * specification. * @@ -245,7 +245,7 @@ public static boolean isXML11Name(int c) { } // isXML11Name(int):boolean /** - * Returns true if the specified character is a valid NCName start + * @return true if the specified character is a valid NCName start * character as defined by production [4] in Namespaces in XML * 1.1 recommendation. * @@ -257,7 +257,7 @@ public static boolean isXML11NCNameStart(int c) { } // isXML11NCNameStart(int):boolean /** - * Returns true if the specified character is a valid NCName + * @return true if the specified character is a valid NCName * character as defined by production [5] in Namespaces in XML * 1.1 recommendation. * @@ -269,7 +269,7 @@ public static boolean isXML11NCName(int c) { } // isXML11NCName(int):boolean /** - * Returns whether the given character is a valid + * @return true if the given character is a valid * high surrogate for a name character. This includes * all high surrogates for characters [0x10000-0xEFFFF]. * In other words everything excluding planes 15 and 16. diff --git a/src/org/apache/xml/serializer/utils/XMLChar.java b/serializer/src/main/java/org/apache/xml/serializer/utils/XMLChar.java similarity index 97% rename from src/org/apache/xml/serializer/utils/XMLChar.java rename to serializer/src/main/java/org/apache/xml/serializer/utils/XMLChar.java index a0d8c8523..f38e8f096 100644 --- a/src/org/apache/xml/serializer/utils/XMLChar.java +++ b/serializer/src/main/java/org/apache/xml/serializer/utils/XMLChar.java @@ -722,7 +722,7 @@ public class XMLChar { // /** - * Returns true if the specified character is a supplemental character. + * @return true if the specified character is a supplemental character. * * @param c The character to check. */ @@ -731,7 +731,7 @@ public static boolean isSupplemental(int c) { } /** - * Returns true the supplemental character corresponding to the given + * @return true the supplemental character corresponding to the given * surrogates. * * @param h The high surrogate. @@ -742,7 +742,7 @@ public static int supplemental(char h, char l) { } /** - * Returns the high surrogate of a supplemental character + * @return the high surrogate of a supplemental character * * @param c The supplemental character to "split". */ @@ -751,7 +751,7 @@ public static char highSurrogate(int c) { } /** - * Returns the low surrogate of a supplemental character + * @return the low surrogate of a supplemental character * * @param c The supplemental character to "split". */ @@ -760,7 +760,7 @@ public static char lowSurrogate(int c) { } /** - * Returns whether the given character is a high surrogate + * @return whether the given character is a high surrogate * * @param c The character to check. */ @@ -769,7 +769,7 @@ public static boolean isHighSurrogate(int c) { } /** - * Returns whether the given character is a low surrogate + * @return whether the given character is a low surrogate * * @param c The character to check. */ @@ -779,7 +779,7 @@ public static boolean isLowSurrogate(int c) { /** - * Returns true if the specified character is valid. This method + * @return true if the specified character is valid. This method * also checks the surrogate character range from 0x10000 to 0x10FFFF. *

    * If the program chooses to apply the mask directly to the @@ -794,7 +794,7 @@ public static boolean isValid(int c) { } // isValid(int):boolean /** - * Returns true if the specified character is invalid. + * @return true if the specified character is invalid. * * @param c The character to check. */ @@ -803,7 +803,7 @@ public static boolean isInvalid(int c) { } // isInvalid(int):boolean /** - * Returns true if the specified character can be considered content. + * @return true if the specified character can be considered content. * * @param c The character to check. */ @@ -813,7 +813,7 @@ public static boolean isContent(int c) { } // isContent(int):boolean /** - * Returns true if the specified character can be considered markup. + * @return true if the specified character can be considered markup. * Markup characters include '<', '&', and '%'. * * @param c The character to check. @@ -823,7 +823,7 @@ public static boolean isMarkup(int c) { } // isMarkup(int):boolean /** - * Returns true if the specified character is a space character + * @return true if the specified character is a space character * as defined by production [3] in the XML 1.0 specification. * * @param c The character to check. @@ -833,7 +833,7 @@ public static boolean isSpace(int c) { } // isSpace(int):boolean /** - * Returns true if the specified character is a valid name start + * @return true if the specified character is a valid name start * character as defined by production [5] in the XML 1.0 * specification. * @@ -844,7 +844,7 @@ public static boolean isNameStart(int c) { } // isNameStart(int):boolean /** - * Returns true if the specified character is a valid name + * @return true if the specified character is a valid name * character as defined by production [4] in the XML 1.0 * specification. * @@ -855,7 +855,7 @@ public static boolean isName(int c) { } // isName(int):boolean /** - * Returns true if the specified character is a valid NCName start + * @return true if the specified character is a valid NCName start * character as defined by production [4] in Namespaces in XML * recommendation. * @@ -866,7 +866,7 @@ public static boolean isNCNameStart(int c) { } // isNCNameStart(int):boolean /** - * Returns true if the specified character is a valid NCName + * @return true if the specified character is a valid NCName * character as defined by production [5] in Namespaces in XML * recommendation. * @@ -877,7 +877,7 @@ public static boolean isNCName(int c) { } // isNCName(int):boolean /** - * Returns true if the specified character is a valid Pubid + * @return true if the specified character is a valid Pubid * character as defined by production [13] in the XML 1.0 * specification. * @@ -968,7 +968,7 @@ public static boolean isValidNmtoken(String nmtoken) { // encodings /** - * Returns true if the encoding name is a valid IANA encoding. + * @return true if the encoding name is a valid IANA encoding. * This method does not verify that there is a decoder available * for this encoding, only that the characters are valid for an * IANA encoding name. @@ -997,7 +997,7 @@ public static boolean isValidIANAEncoding(String ianaEncoding) { } // isValidIANAEncoding(String):boolean /** - * Returns true if the encoding name is a valid Java encoding. + * @return true if the encoding name is a valid Java encoding. * This method does not verify that there is a decoder available * for this encoding, only that the characters are valid for an * Java encoding name. diff --git a/src/org/apache/xml/serializer/Encodings.properties b/serializer/src/main/resources/org/apache/xml/serializer/Encodings.properties similarity index 100% rename from src/org/apache/xml/serializer/Encodings.properties rename to serializer/src/main/resources/org/apache/xml/serializer/Encodings.properties diff --git a/src/org/apache/xml/serializer/HTMLEntities.properties b/serializer/src/main/resources/org/apache/xml/serializer/HTMLEntities.properties similarity index 100% rename from src/org/apache/xml/serializer/HTMLEntities.properties rename to serializer/src/main/resources/org/apache/xml/serializer/HTMLEntities.properties diff --git a/src/org/apache/xml/serializer/XMLEntities.properties b/serializer/src/main/resources/org/apache/xml/serializer/XMLEntities.properties similarity index 100% rename from src/org/apache/xml/serializer/XMLEntities.properties rename to serializer/src/main/resources/org/apache/xml/serializer/XMLEntities.properties diff --git a/src/org/apache/xml/serializer/output_html.properties b/serializer/src/main/resources/org/apache/xml/serializer/output_html.properties similarity index 100% rename from src/org/apache/xml/serializer/output_html.properties rename to serializer/src/main/resources/org/apache/xml/serializer/output_html.properties diff --git a/src/org/apache/xml/serializer/output_text.properties b/serializer/src/main/resources/org/apache/xml/serializer/output_text.properties similarity index 100% rename from src/org/apache/xml/serializer/output_text.properties rename to serializer/src/main/resources/org/apache/xml/serializer/output_text.properties diff --git a/src/org/apache/xml/serializer/output_unknown.properties b/serializer/src/main/resources/org/apache/xml/serializer/output_unknown.properties similarity index 100% rename from src/org/apache/xml/serializer/output_unknown.properties rename to serializer/src/main/resources/org/apache/xml/serializer/output_unknown.properties diff --git a/src/org/apache/xml/serializer/output_xml.properties b/serializer/src/main/resources/org/apache/xml/serializer/output_xml.properties similarity index 100% rename from src/org/apache/xml/serializer/output_xml.properties rename to serializer/src/main/resources/org/apache/xml/serializer/output_xml.properties diff --git a/serializer/src/main/resources/org/apache/xml/serializer/package.html b/serializer/src/main/resources/org/apache/xml/serializer/package.html new file mode 100644 index 000000000..d4dffd139 --- /dev/null +++ b/serializer/src/main/resources/org/apache/xml/serializer/package.html @@ -0,0 +1,43 @@ + + + + Xalan Serializer Package. + +

    Processes SAX events into streams.

    + +

    The {@link org.apache.xml.serializer.SerializerFactory} is used to + create a {@link org.apache.xml.serializer.Serializer} from a set of + output properties (see {@link javax.xml.transform.OutputKeys}).

    +

    {@link org.apache.xml.serializer.ToStream} acts as the main + baseclass for the Xalan serializer implementations. + {@link org.apache.xml.serializer.ToHTMLStream} derives from this + to implement HTML serialization. + {@link org.apache.xml.serializer.ToTextStream} + implements plain text serialization. + {@link org.apache.xml.serializer.ToXMLStream} + implements XML serialization. +

    +

    XML mapping from characters to entity references is defined in + XMLEntities.res. HTML entity reference mapping is defined in HTMLEntities.res. +

    +

    Encoding information is defined in {@link org.apache.xml.serializer.Encodings}.

    + + + + diff --git a/serializer/src/main/resources/org/apache/xml/serializer/version.properties b/serializer/src/main/resources/org/apache/xml/serializer/version.properties new file mode 100644 index 000000000..defbd4820 --- /dev/null +++ b/serializer/src/main/resources/org/apache/xml/serializer/version.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/serializer/src/test/java/org/apache/xml/serializer/VersionTest.java b/serializer/src/test/java/org/apache/xml/serializer/VersionTest.java new file mode 100644 index 000000000..486af2b60 --- /dev/null +++ b/serializer/src/test/java/org/apache/xml/serializer/VersionTest.java @@ -0,0 +1,132 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.xml.serializer; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.Isolated; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import org.mockito.MockedStatic; +import org.mockito.Mockito; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +@Isolated("redirecting System.err is not thread-safe") +public class VersionTest { + private static final PrintStream originalPrintStream = System.err; + private static final ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + private static final PrintStream mockPrintStream = new PrintStream(buffer, true); + + @BeforeAll + public static void beforeAll() { + System.setErr(mockPrintStream); + } + + @AfterAll + public static void afterAll() { + System.setErr(originalPrintStream); + } + + @BeforeEach + public void beforeEach() { + buffer.reset(); + } + + @ParameterizedTest(name = "{0} -> {2}") + @MethodSource("testReadPropertiesArgs") + public void testReadProperties(String ignoredName, String properties, String version) { + try (MockedStatic versionMock = Mockito.mockStatic(Version.class, Mockito.CALLS_REAL_METHODS)) { + versionMock + .when(Version::getPropertiesStream) + .thenReturn(new ByteArrayInputStream(properties.getBytes())); + assertEquals(version, Version.readVersionNumber()); + } + } + + private static Stream testReadPropertiesArgs() { + return Stream.of( + Arguments.of("single line without line feed", "version=1.2.3", "1.2.3"), + Arguments.of("single line with line feed", "version=4.5.D6-SNAPSHOT\n", "4.5.D6-SNAPSHOT"), + Arguments.of("multiple lines with version number", "foo=bar\nversion=7.8.9\nbaz=zot\n", "7.8.9"), + Arguments.of("single line without version number", "verXion=7.8.9\n", "0.0.0"), + Arguments.of("multiple lines without version number", "foo=bar\nverXion=7.8.9\nbaz=zot\n", "0.0.0") + ); + } + + @Test + public void testCannotReadProperties() { + try (MockedStatic versionMock = Mockito.mockStatic(Version.class, Mockito.CALLS_REAL_METHODS)) { + versionMock + .when(Version::getPropertiesStream) + .thenThrow(NullPointerException.class); + assertEquals("0.0.0", Version.readVersionNumber()); + assertTrue(buffer.toString().contains("RuntimeException: Cannot read properties file")); + } + } + + @ParameterizedTest(name = "{0} -> {1}") + @MethodSource("testParseVersionNumberArgs") + public void testParseVersionNumber( + String inputVersion, boolean matchSuccessful, String parsedVersion, + int major, int release, int maintenance, int development, boolean snapshot + ) { + Version.parseVersionNumber(inputVersion); + assertEquals(parsedVersion, Version.getVersion()); + assertEquals(major, Version.getMajorVersionNum()); + assertEquals(release, Version.getReleaseVersionNum()); + assertEquals(maintenance, Version.getMaintenanceVersionNum()); + assertEquals(development, Version.getDevelopmentVersionNum()); + assertEquals(snapshot, Version.isSnapshot()); + boolean cannotMatchWarningFound = buffer.toString().contains("Cannot match Xalan version"); + assertEquals(matchSuccessful, !cannotMatchWarningFound); + } + + private static Stream testParseVersionNumberArgs() { + return Stream.of( + // Pattern match + Arguments.of("1.2.3", true, "Xalan Serializer Java 1.2.3", 1, 2, 3, 0, false), + Arguments.of("1.2.D3", true, "Xalan Serializer Java 1.2.D3", 1, 2, 0, 3, false), + Arguments.of("1.2.3-SNAPSHOT", true, "Xalan Serializer Java 1.2.3-SNAPSHOT", 1, 2, 3, 0, true), + Arguments.of("1.2.D03-SNAPSHOT", true, "Xalan Serializer Java 1.2.D3-SNAPSHOT", 1, 2, 0, 3, true), + Arguments.of("0.0.0", true, "Xalan Serializer Java 0.0.0", 0, 0, 0, 0, false), + // No pattern match + Arguments.of("", false, "Xalan Serializer Java 0.0.0", 0, 0, 0, 0, false), + Arguments.of("-1.2.3", false, "Xalan Serializer Java 0.0.0", 0, 0, 0, 0, false), + Arguments.of("-1.2.3", false, "Xalan Serializer Java 0.0.0", 0, 0, 0, 0, false), + Arguments.of("1. 2.3", false, "Xalan Serializer Java 0.0.0", 0, 0, 0, 0, false), + Arguments.of("1.2.D3x", false, "Xalan Serializer Java 0.0.0", 0, 0, 0, 0, false), + Arguments.of("1.2.3-XSNAPSHOT", false, "Xalan Serializer Java 0.0.0", 0, 0, 0, 0, false), + Arguments.of("1.2.D3-snapshot", false, "Xalan Serializer Java 0.0.0", 0, 0, 0, 0, false), + Arguments.of("1.2.D3-SNAPSHOT-1", false, "Xalan Serializer Java 0.0.0", 0, 0, 0, 0, false), + // Input version null -> cannot happen in class under test, but we know + // what would happen if it did + Arguments.of(null, true, "Xalan Serializer Java 0.0.0", 0, 0, 0, 0, false) + ); + } + +} diff --git a/src/org/apache/xalan/Version.src b/src/org/apache/xalan/Version.src deleted file mode 100644 index ae942c784..000000000 --- a/src/org/apache/xalan/Version.src +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* - * $Id$ - */ -package org.apache.xalan; - -/** - * Administrative class to keep track of the version number of - * the Xalan release. - *

    This class implements the upcoming standard of having - * org.apache.project-name.Version.getVersion() be a standard way - * to get version information. This class will replace the older - * org.apache.xalan.processor.Version class.

    - *

    See also: org/apache/xalan/res/XSLTInfo.properties for - * information about the version of the XSLT spec we support.

    - * @xsl.usage general - */ -public class Version -{ - - /** - * Get the basic version string for the current Xalan release. - * Version String formatted like - * "Xalan Java v.r[.dd| Dnn]". - * - * Futurework: have this read version info from jar manifest. - * - * @return String denoting our current version - */ - public static String getVersion() - { - return getProduct()+" "+getImplementationLanguage()+" " - +getMajorVersionNum()+"."+getReleaseVersionNum()+"." - +( (getDevelopmentVersionNum() > 0) ? - ("D"+getDevelopmentVersionNum()) : (""+getMaintenanceVersionNum())); - } - - /** - * Print the processor version to the command line. - * - * @param argv command line arguments, unused. - */ - public static void main(String argv[]) - { - System.out.println(getVersion()); - } - - /** - * Name of product: Xalan. - */ - public static String getProduct() - { - return "Xalan"; - } - - /** - * Implementation Language: Java. - */ - public static String getImplementationLanguage() - { - return "Java"; - } - - - /** - * Major version number. - * Version number. This changes only when there is a - * significant, externally apparent enhancement from - * the previous release. 'n' represents the n'th - * version. - * - * Clients should carefully consider the implications - * of new versions as external interfaces and behaviour - * may have changed. - */ - public static int getMajorVersionNum() - { - return @version.VERSION@; - - } - - /** - * Release Number. - * Release number. This changes when: - * - a new set of functionality is to be added, eg, - * implementation of a new W3C specification. - * - API or behaviour change. - * - its designated as a reference release. - */ - public static int getReleaseVersionNum() - { - return @version.RELEASE@; - } - - /** - * Maintenance Drop Number. - * Optional identifier used to designate maintenance - * drop applied to a specific release and contains - * fixes for defects reported. It maintains compatibility - * with the release and contains no API changes. - * When missing, it designates the final and complete - * development drop for a release. - */ - public static int getMaintenanceVersionNum() - { - return @version.MINOR@; - } - - /** - * Development Drop Number. - * Optional identifier designates development drop of - * a specific release. D01 is the first development drop - * of a new release. - * - * Development drops are works in progress towards a - * compeleted, final release. A specific development drop - * may not completely implement all aspects of a new - * feature, which may take several development drops to - * complete. At the point of the final drop for the - * release, the D suffix will be omitted. - * - * Each 'D' drops can contain functional enhancements as - * well as defect fixes. 'D' drops may not be as stable as - * the final releases. - */ - public static int getDevelopmentVersionNum() - { - try { - if ((new String("@version.DEVELOPER@")).length() == 0) - return 0; - else - return Integer.parseInt("@version.DEVELOPER@"); - } catch (NumberFormatException nfe) { - return 0; - } - } -} diff --git a/src/org/apache/xalan/processor/XSLProcessorVersion.src b/src/org/apache/xalan/processor/XSLProcessorVersion.src deleted file mode 100644 index 7c44d46cb..000000000 --- a/src/org/apache/xalan/processor/XSLProcessorVersion.src +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* - * $Id$ - */ -package org.apache.xalan.processor; - -/** - * Administrative class to keep track of the version number of - * the Xalan release. - *

    See also: org/apache/xalan/res/XSLTInfo.properties

    - * @deprecated To be replaced by org.apache.xalan.Version.getVersion() - * @xsl.usage general - */ -public class XSLProcessorVersion -{ - - /** - * Print the processor version to the command line. - * - * @param argv command line arguments, unused. - */ - public static void main(String argv[]) - { - System.out.println(S_VERSION); - } - - /** - * Constant name of product. - */ - public static final String PRODUCT = "Xalan"; - - /** - * Implementation Language. - */ - public static final String LANGUAGE = "Java"; - - /** - * Major version number. - * Version number. This changes only when there is a - * significant, externally apparent enhancement from - * the previous release. 'n' represents the n'th - * version. - * - * Clients should carefully consider the implications - * of new versions as external interfaces and behaviour - * may have changed. - */ - public static final int VERSION = @version.VERSION@; - - /** - * Release Number. - * Release number. This changes when: - * - a new set of functionality is to be added, eg, - * implementation of a new W3C specification. - * - API or behaviour change. - * - its designated as a reference release. - */ - public static final int RELEASE = @version.RELEASE@; - - /** - * Maintenance Drop Number. - * Optional identifier used to designate maintenance - * drop applied to a specific release and contains - * fixes for defects reported. It maintains compatibility - * with the release and contains no API changes. - * When missing, it designates the final and complete - * development drop for a release. - */ - public static final int MAINTENANCE = @version.MINOR@; - - /** - * Development Drop Number. - * Optional identifier designates development drop of - * a specific release. D01 is the first development drop - * of a new release. - * - * Development drops are works in progress towards a - * compeleted, final release. A specific development drop - * may not completely implement all aspects of a new - * feature, which may take several development drops to - * complete. At the point of the final drop for the - * release, the D suffix will be omitted. - * - * Each 'D' drops can contain functional enhancements as - * well as defect fixes. 'D' drops may not be as stable as - * the final releases. - */ - public static final int DEVELOPMENT = 0; - - /** - * Version String like "Xalan Language - * v.r[.dd| Dnn]". - *

    Semantics of the version string are identical to the Xerces project.

    - */ - public static final String S_VERSION = PRODUCT+" "+LANGUAGE+" " - +VERSION+"."+RELEASE+"." - +(DEVELOPMENT > 0 ? ("D"+DEVELOPMENT) - : (""+MAINTENANCE)); - -} diff --git a/src/org/apache/xalan/xsltc/util/JavaCupRedirect.java b/src/org/apache/xalan/xsltc/util/JavaCupRedirect.java deleted file mode 100644 index 6ca533d35..000000000 --- a/src/org/apache/xalan/xsltc/util/JavaCupRedirect.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* - * $Id$ - */ - -package org.apache.xalan.xsltc.util; - -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; - -/** - * Utility class to redirect input to JavaCup program. - * - * Usage-command line: - * java org.apache.xalan.xsltc.utils.JavaCupRedirect [args] -stdin filename.ext - * - * @author Morten Jorgensen - * @version $Id$ - */ -public class JavaCupRedirect { - - private final static String ERRMSG = - "You must supply a filename with the -stdin option."; - - public static void main (String args[]) { - - // If we should call System.exit or not - //@todo make this settable for use inside other java progs - boolean systemExitOK = true; - - // This is the stream we'll set as our System.in - InputStream input = null; - - // The number of arguments - final int argc = args.length; - - // The arguments we'll pass to the real 'main()' - String[] new_args = new String[argc - 2]; - int new_argc = 0; - - // Parse all parameters passed to this class - for (int i = 0; i < argc; i++) { - // Parse option '-stdin ' - if (args[i].equals("-stdin")) { - // This option must have an argument - if ((++i >= argc) || (args[i].startsWith("-"))) { - System.err.println(ERRMSG); - throw new RuntimeException(ERRMSG); - } - try { - input = new FileInputStream(args[i]); - } - catch (FileNotFoundException e) { - System.err.println("Could not open file "+args[i]); - throw new RuntimeException(e.getMessage()); - } - catch (SecurityException e) { - System.err.println("No permission to file "+args[i]); - throw new RuntimeException(e.getMessage()); - } - } - else { - if (new_argc == new_args.length) { - System.err.println("Missing -stdin option!"); - throw new RuntimeException(); - } - new_args[new_argc++] = args[i]; - } - } - - System.setIn(input); - try { - java_cup.Main.main(new_args); - } - catch (Exception e) { - System.err.println("Error running JavaCUP:"); - e.printStackTrace(); - } - } -} diff --git a/src/org/apache/xml/serializer/Version.src b/src/org/apache/xml/serializer/Version.src deleted file mode 100644 index deb26637f..000000000 --- a/src/org/apache/xml/serializer/Version.src +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* - * $Id$ - */ -package org.apache.xml.serializer; - -/** - * Administrative class to keep track of the version number of - * the Serializer release. - *

    This class implements the upcoming standard of having - * org.apache.project-name.Version.getVersion() be a standard way - * to get version information.

    - * @xsl.usage general - */ -public final class Version -{ - - /** - * Get the basic version string for the current Serializer. - * Version String formatted like - * "Serializer Java v.r[.dd| Dnn]". - * - * Futurework: have this read version info from jar manifest. - * - * @return String denoting our current version - */ - public static String getVersion() - { - return getProduct()+" "+getImplementationLanguage()+" " - +getMajorVersionNum()+"."+getReleaseVersionNum()+"." - +( (getDevelopmentVersionNum() > 0) ? - ("D"+getDevelopmentVersionNum()) : (""+getMaintenanceVersionNum())); - } - - /** - * Print the processor version to the command line. - * - * @param argv command line arguments, unused. - */ - public static void main(String argv[]) - { - System.out.println(getVersion()); - } - - /** - * Name of product: Serializer. - */ - public static String getProduct() - { - return "Serializer"; - } - - /** - * Implementation Language: Java. - */ - public static String getImplementationLanguage() - { - return "Java"; - } - - - /** - * Major version number. - * Version number. This changes only when there is a - * significant, externally apparent enhancement from - * the previous release. 'n' represents the n'th - * version. - * - * Clients should carefully consider the implications - * of new versions as external interfaces and behaviour - * may have changed. - */ - public static int getMajorVersionNum() - { - return @version.VERSION@; - - } - - /** - * Release Number. - * Release number. This changes when: - * - a new set of functionality is to be added, eg, - * implementation of a new W3C specification. - * - API or behaviour change. - * - its designated as a reference release. - */ - public static int getReleaseVersionNum() - { - return @version.RELEASE@; - } - - /** - * Maintenance Drop Number. - * Optional identifier used to designate maintenance - * drop applied to a specific release and contains - * fixes for defects reported. It maintains compatibility - * with the release and contains no API changes. - * When missing, it designates the final and complete - * development drop for a release. - */ - public static int getMaintenanceVersionNum() - { - return @version.MINOR@; - } - - /** - * Development Drop Number. - * Optional identifier designates development drop of - * a specific release. D01 is the first development drop - * of a new release. - * - * Development drops are works in progress towards a - * compeleted, final release. A specific development drop - * may not completely implement all aspects of a new - * feature, which may take several development drops to - * complete. At the point of the final drop for the - * release, the D suffix will be omitted. - * - * Each 'D' drops can contain functional enhancements as - * well as defect fixes. 'D' drops may not be as stable as - * the final releases. - */ - public static int getDevelopmentVersionNum() - { - try { - if ((new String("@version.DEVELOPER@")).length() == 0) - return 0; - else - return Integer.parseInt("@version.DEVELOPER@"); - } catch (NumberFormatException nfe) { - return 0; - } - } -} diff --git a/src/xml-commons-external-1.3.02-src.tar.gz b/src/xml-commons-external-1.3.02-src.tar.gz deleted file mode 100644 index 469b3bd7c..000000000 Binary files a/src/xml-commons-external-1.3.02-src.tar.gz and /dev/null differ diff --git a/stylebook/dtd/blocks.ent b/stylebook/dtd/blocks.ent new file mode 100644 index 000000000..5f352d1bf --- /dev/null +++ b/stylebook/dtd/blocks.ent @@ -0,0 +1,40 @@ + + + + + + + +%markupEntity; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/stylebook/dtd/book.dtd b/stylebook/dtd/book.dtd new file mode 100644 index 000000000..2f49ce990 --- /dev/null +++ b/stylebook/dtd/book.dtd @@ -0,0 +1,49 @@ + + + + + + +%externalEntity; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/stylebook/dtd/changes.dtd b/stylebook/dtd/changes.dtd new file mode 100644 index 000000000..661affa86 --- /dev/null +++ b/stylebook/dtd/changes.dtd @@ -0,0 +1,24 @@ + + + + + + +%markupEntity; + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/stylebook/dtd/characters.ent b/stylebook/dtd/characters.ent new file mode 100644 index 000000000..036c06d5e --- /dev/null +++ b/stylebook/dtd/characters.ent @@ -0,0 +1,297 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/stylebook/dtd/document.dtd b/stylebook/dtd/document.dtd new file mode 100644 index 000000000..f7cf5b121 --- /dev/null +++ b/stylebook/dtd/document.dtd @@ -0,0 +1,19 @@ + + + + + + +%blocksEntity; + + + + + + + + + + + + \ No newline at end of file diff --git a/stylebook/dtd/faqs.dtd b/stylebook/dtd/faqs.dtd new file mode 100644 index 000000000..565d99f4b --- /dev/null +++ b/stylebook/dtd/faqs.dtd @@ -0,0 +1,19 @@ + + + + + + +%blocksEntity; + + + + + + + + + + + + \ No newline at end of file diff --git a/stylebook/dtd/links.ent b/stylebook/dtd/links.ent new file mode 100644 index 000000000..63b002fff --- /dev/null +++ b/stylebook/dtd/links.ent @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/stylebook/dtd/markup.ent b/stylebook/dtd/markup.ent new file mode 100644 index 000000000..66319e5f7 --- /dev/null +++ b/stylebook/dtd/markup.ent @@ -0,0 +1,21 @@ + + + + + + + +%externalEntity; + + +%charEntity; + + +%linksEntity; + + + + + + + \ No newline at end of file diff --git a/xdocs/style/dtd/spec.dtd b/stylebook/dtd/spec.dtd similarity index 100% rename from xdocs/style/dtd/spec.dtd rename to stylebook/dtd/spec.dtd diff --git a/xdocs/style/dtd/xsl-html40s.dtd b/stylebook/dtd/xsl-html40s.dtd similarity index 100% rename from xdocs/style/dtd/xsl-html40s.dtd rename to stylebook/dtd/xsl-html40s.dtd diff --git a/stylebook/graphics/button-a.gif b/stylebook/graphics/button-a.gif new file mode 100644 index 000000000..5d0b8c242 Binary files /dev/null and b/stylebook/graphics/button-a.gif differ diff --git a/stylebook/graphics/button-b.gif b/stylebook/graphics/button-b.gif new file mode 100644 index 000000000..06e03811a Binary files /dev/null and b/stylebook/graphics/button-b.gif differ diff --git a/stylebook/loader.xml b/stylebook/loader.xml new file mode 100644 index 000000000..a416d8426 --- /dev/null +++ b/stylebook/loader.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/xdocs/style/loaderdesign.xml b/stylebook/loaderdesign.xml similarity index 100% rename from xdocs/style/loaderdesign.xml rename to stylebook/loaderdesign.xml diff --git a/stylebook/resources/bottom.gif b/stylebook/resources/bottom.gif new file mode 100644 index 000000000..f39031efa Binary files /dev/null and b/stylebook/resources/bottom.gif differ diff --git a/stylebook/resources/button-asf-hi.gif b/stylebook/resources/button-asf-hi.gif new file mode 100644 index 000000000..08b880a74 Binary files /dev/null and b/stylebook/resources/button-asf-hi.gif differ diff --git a/stylebook/resources/button-asf-lo.gif b/stylebook/resources/button-asf-lo.gif new file mode 100644 index 000000000..134580f37 Binary files /dev/null and b/stylebook/resources/button-asf-lo.gif differ diff --git a/stylebook/resources/button-w3c-hi.gif b/stylebook/resources/button-w3c-hi.gif new file mode 100644 index 000000000..3bf0be395 Binary files /dev/null and b/stylebook/resources/button-w3c-hi.gif differ diff --git a/stylebook/resources/button-w3c-lo.gif b/stylebook/resources/button-w3c-lo.gif new file mode 100644 index 000000000..d383d3dd9 Binary files /dev/null and b/stylebook/resources/button-w3c-lo.gif differ diff --git a/stylebook/resources/button-xml-hi.gif b/stylebook/resources/button-xml-hi.gif new file mode 100644 index 000000000..01d095ce4 Binary files /dev/null and b/stylebook/resources/button-xml-hi.gif differ diff --git a/stylebook/resources/button-xml-lo.gif b/stylebook/resources/button-xml-lo.gif new file mode 100644 index 000000000..5719c7ef0 Binary files /dev/null and b/stylebook/resources/button-xml-lo.gif differ diff --git a/stylebook/resources/close.gif b/stylebook/resources/close.gif new file mode 100644 index 000000000..48a9782ce Binary files /dev/null and b/stylebook/resources/close.gif differ diff --git a/stylebook/resources/dot.gif b/stylebook/resources/dot.gif new file mode 100644 index 000000000..6227d1d86 Binary files /dev/null and b/stylebook/resources/dot.gif differ diff --git a/stylebook/resources/join.gif b/stylebook/resources/join.gif new file mode 100644 index 000000000..02e7611bb Binary files /dev/null and b/stylebook/resources/join.gif differ diff --git a/stylebook/resources/line.gif b/stylebook/resources/line.gif new file mode 100644 index 000000000..fd25c3943 Binary files /dev/null and b/stylebook/resources/line.gif differ diff --git a/stylebook/resources/logo.gif b/stylebook/resources/logo.gif new file mode 100644 index 000000000..53538c3f6 Binary files /dev/null and b/stylebook/resources/logo.gif differ diff --git a/stylebook/resources/note.gif b/stylebook/resources/note.gif new file mode 100644 index 000000000..339422266 Binary files /dev/null and b/stylebook/resources/note.gif differ diff --git a/stylebook/resources/right.gif b/stylebook/resources/right.gif new file mode 100644 index 000000000..bcb50e386 Binary files /dev/null and b/stylebook/resources/right.gif differ diff --git a/stylebook/resources/script.js b/stylebook/resources/script.js new file mode 100644 index 000000000..ebadeb2b8 --- /dev/null +++ b/stylebook/resources/script.js @@ -0,0 +1,21 @@ +rolloverImagesOn=new Array(); +rolloverImagesOff=new Array(); + +function rolloverOn(name) { + if(rolloverImagesOn[name]){ + document.images[name].src=rolloverImagesOn[name].src; + } +} + +function rolloverOff(name) { + if(rolloverImagesOff[name]){ + document.images[name].src=rolloverImagesOff[name].src; + } +} + +function rolloverLoad(name,on,off) { + rolloverImagesOn[name]=new Image(); + rolloverImagesOn[name].src=on; + rolloverImagesOff[name]=new Image(); + rolloverImagesOff[name].src=off; +} diff --git a/stylebook/resources/separator.gif b/stylebook/resources/separator.gif new file mode 100644 index 000000000..e7749432f Binary files /dev/null and b/stylebook/resources/separator.gif differ diff --git a/stylebook/resources/void.gif b/stylebook/resources/void.gif new file mode 100644 index 000000000..75b945d25 Binary files /dev/null and b/stylebook/resources/void.gif differ diff --git a/xdocs/sources/design/compilation.gif b/stylebook/sources/design/compilation.gif similarity index 100% rename from xdocs/sources/design/compilation.gif rename to stylebook/sources/design/compilation.gif diff --git a/xdocs/sources/design/conceptual.gif b/stylebook/sources/design/conceptual.gif similarity index 100% rename from xdocs/sources/design/conceptual.gif rename to stylebook/sources/design/conceptual.gif diff --git a/xdocs/sources/design/data.gif b/stylebook/sources/design/data.gif similarity index 100% rename from xdocs/sources/design/data.gif rename to stylebook/sources/design/data.gif diff --git a/xdocs/sources/design/design2_0_0.xml b/stylebook/sources/design/design2_0_0.xml similarity index 100% rename from xdocs/sources/design/design2_0_0.xml rename to stylebook/sources/design/design2_0_0.xml diff --git a/xdocs/sources/design/org_apache.gif b/stylebook/sources/design/org_apache.gif similarity index 100% rename from xdocs/sources/design/org_apache.gif rename to stylebook/sources/design/org_apache.gif diff --git a/xdocs/sources/design/process.gif b/stylebook/sources/design/process.gif similarity index 100% rename from xdocs/sources/design/process.gif rename to stylebook/sources/design/process.gif diff --git a/xdocs/sources/design/trax.gif b/stylebook/sources/design/trax.gif similarity index 100% rename from xdocs/sources/design/trax.gif rename to stylebook/sources/design/trax.gif diff --git a/xdocs/sources/design/xalan.gif b/stylebook/sources/design/xalan.gif similarity index 100% rename from xdocs/sources/design/xalan.gif rename to stylebook/sources/design/xalan.gif diff --git a/xdocs/sources/design/xalan1_1x1.gif b/stylebook/sources/design/xalan1_1x1.gif similarity index 100% rename from xdocs/sources/design/xalan1_1x1.gif rename to stylebook/sources/design/xalan1_1x1.gif diff --git a/xdocs/sources/design/xmllogo.gif b/stylebook/sources/design/xmllogo.gif similarity index 100% rename from xdocs/sources/design/xmllogo.gif rename to stylebook/sources/design/xmllogo.gif diff --git a/xdocs/sources/design/xpath.gif b/stylebook/sources/design/xpath.gif similarity index 100% rename from xdocs/sources/design/xpath.gif rename to stylebook/sources/design/xpath.gif diff --git a/xdocs/sources/design/xslt_abstract.gif b/stylebook/sources/design/xslt_abstract.gif similarity index 100% rename from xdocs/sources/design/xslt_abstract.gif rename to stylebook/sources/design/xslt_abstract.gif diff --git a/xdocs/sources/entities.src b/stylebook/sources/entities.ent similarity index 100% rename from xdocs/sources/entities.src rename to stylebook/sources/entities.ent diff --git a/stylebook/sources/entities.src b/stylebook/sources/entities.src new file mode 100644 index 000000000..b58c39218 --- /dev/null +++ b/stylebook/sources/entities.src @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +&xslt4jc-short;
  • '> + + +

    In April 2001, Sun donated &xslt4jc-short; to the Xalan project. &xslt4jc-short; compiles stylesheets into translets and + provides a runtime environment for using translets to transform XML documents. Initially, &xslt4jc-short; is + available in a separate JAR. Over time, we plan to integrate the two codebases. For more information, + see Getting Started with &xslt4jc-short;, + &xslt4jc-short; + Release Notes, and &xslt4jc-short; Design.

    +
    '> + +For &xslt4jc-short; changes since &xslt4jc-short; was incorporated into &xslt4j;, see + &xslt4jc-short; software changes.'> + +If you are using &xslt4jc-short;, see + Setting the system classpath for &xslt4jc-short;.

    '> + +translets'> + + +
      +
    • JAXPTransletOneTransformation
    • +
    • JAXPTransletMultipleTransformations
    • +
    • Other &xslt4jc-short; samples
    • +
    +

    You can use the JAXP interfaces to compile and run translets. + For an overview of the usage patterns these samples illustrate, see + Calling &xslt4jc-short; with the JAXP API.

    + + +

    What it does: Uses the &xslt4jc-short; TransformerFactory to compile a translet and use + the translet to transform the &xslt4jc-short; to-do list from XML into HTML.

    +

    Run this sample from the translets subdirectory with

    +

    java JAXPTransletOneTransformation

    +

    View the result in todo.html.

    +
    + +

    What it does: Uses the &xslt4jc-short; TransformerFactory to compile a translet and use + the Templates object associated with the translet to transform the &xslt4jc-short; and Xalan to-do lists from XML + into HTML.

    +

    Run this sample from the translets subdirectory with

    +

    java JAXPTransletMultipleTransformations

    +

    View the results in todo.html and todotoo.html.

    +
    + +

    Other &xslt4jc-short; samples are located in the following samples subdirectories:

    +
      +
    • CompiledServlet
    • +
    • CompiledBrazil
    • +
    • CompiledJAXP
    • +
    • CompiledApplet
    • +
    • CompiledEJB
    • +
    +

    For information about each of these samples, consult the README file in the subdirectory.

    +

    &xslt4jc-short; provides demos for using &xslt4jc-short; as a servlet and as a handler for + Brazil (a new and powerful Web techology from Sun labs).

    +

    To run the Brazil-handler demo, download Brazil from sunlabs:

    +

        http://research.sun.com/research/download/index.html

    +

    The translet must be specified as a pure class name, + accessible through the Brazil-handler's classpath. For + example:

    +

        translet=mk054

    +

    The document must be specified as a valid URL. For example:

    +

        document=http://server/path/to/filename.xml

    +

    If the file is local to the Brazil handler, it has to be + specified using the "file:filename.xml" format.

    + In order to run the Brazil-handler demo, you also need to + make the Brazil and javax classes available from your + classpath +

    To run the servlet demo, download the java extensions for servlets from Sun:

    +

         + + http://java.sun.com/products/servlet/download.html

    +
    +
    '> diff --git a/xdocs/sources/xalan-apache-org-site.xml b/stylebook/sources/xalan-apache-org-site.xml similarity index 100% rename from xdocs/sources/xalan-apache-org-site.xml rename to stylebook/sources/xalan-apache-org-site.xml diff --git a/xdocs/sources/xalan-apache-org/index.xml b/stylebook/sources/xalan-apache-org/index.xml similarity index 100% rename from xdocs/sources/xalan-apache-org/index.xml rename to stylebook/sources/xalan-apache-org/index.xml diff --git a/xdocs/sources/xalan-collate.xsl b/stylebook/sources/xalan-collate.xsl similarity index 100% rename from xdocs/sources/xalan-collate.xsl rename to stylebook/sources/xalan-collate.xsl diff --git a/xdocs/sources/xalan-jlocal.xml b/stylebook/sources/xalan-jlocal.xml similarity index 100% rename from xdocs/sources/xalan-jlocal.xml rename to stylebook/sources/xalan-jlocal.xml diff --git a/xdocs/sources/xalan-jsite.xml b/stylebook/sources/xalan-jsite.xml similarity index 100% rename from xdocs/sources/xalan-jsite.xml rename to stylebook/sources/xalan-jsite.xml diff --git a/stylebook/sources/xalan/DONE b/stylebook/sources/xalan/DONE new file mode 100644 index 000000000..e69de29bb diff --git a/xdocs/sources/xalan/bugreporting.xml b/stylebook/sources/xalan/bugreporting.xml similarity index 100% rename from xdocs/sources/xalan/bugreporting.xml rename to stylebook/sources/xalan/bugreporting.xml diff --git a/xdocs/sources/xalan/builds.xml b/stylebook/sources/xalan/builds.xml similarity index 100% rename from xdocs/sources/xalan/builds.xml rename to stylebook/sources/xalan/builds.xml diff --git a/xdocs/sources/xalan/charter.xml b/stylebook/sources/xalan/charter.xml similarity index 100% rename from xdocs/sources/xalan/charter.xml rename to stylebook/sources/xalan/charter.xml diff --git a/xdocs/sources/xalan/commandline.xml b/stylebook/sources/xalan/commandline.xml similarity index 100% rename from xdocs/sources/xalan/commandline.xml rename to stylebook/sources/xalan/commandline.xml diff --git a/xdocs/sources/xalan/commandline_xsltc.xml b/stylebook/sources/xalan/commandline_xsltc.xml similarity index 100% rename from xdocs/sources/xalan/commandline_xsltc.xml rename to stylebook/sources/xalan/commandline_xsltc.xml diff --git a/xdocs/sources/xalan/contact_us.xml b/stylebook/sources/xalan/contact_us.xml similarity index 89% rename from xdocs/sources/xalan/contact_us.xml rename to stylebook/sources/xalan/contact_us.xml index 92e948bef..43a93046c 100644 --- a/xdocs/sources/xalan/contact_us.xml +++ b/stylebook/sources/xalan/contact_us.xml @@ -89,14 +89,21 @@

    To subscribe an email account to the Xalan user mailing list send a note to - xalan-j-users-subscribe@xml.apache.org from that account. To unsubscribe - do the same, except replace subscribe with unsubscribe. + j-users-subscribe@xalan.apache.org from that account.

    To subscribe to the Xalan developer mailing list send a note to - xalan-dev-subscribe@xml.apache.org. To unsubscribe - do the same, except replace subscribe with unsubscribe. -

    + dev-subscribe@xalan.apache.org. +

    +

    + For either of these mailing lists, doing the same but replacing + subscribe with help will return a message + telling you more about configuring your subscription's behavior. +

    +

    + To stop receiving mail from one of these lists, do the same but replace + subscribe with unsubscribe. +

    For more information on XML related Apache mailing lists go to Apache mailing lists. diff --git a/xdocs/sources/xalan/downloads.xml b/stylebook/sources/xalan/downloads.xml similarity index 94% rename from xdocs/sources/xalan/downloads.xml rename to stylebook/sources/xalan/downloads.xml index 8d4d9ac8d..d02af5418 100644 --- a/xdocs/sources/xalan/downloads.xml +++ b/stylebook/sources/xalan/downloads.xml @@ -84,13 +84,12 @@ If you have downloaded a binary distribution, you already have a build (you have the jars). This is also true for a source distribution, however if you downloaded a source distribution, - you have the option to use Ant to build &xslt4j;, - including xalan.jar, xsltc.jar, serializer.jar + you have the option to use Maven to build &xslt4j;, + including xalan.jar, serializer.jar and other things, see Using Ant for more details.

    - @@ -207,27 +206,35 @@ the test harness provided with Xalan then it is easiest if you keep the local directory names as suggested. With your paths set up to compile Java code, go into the local java - directory and issue these two commands: + directory and issue the command: + + mvnbuild.sh + + or, on windows, + + mvnbuild.bat + + This is equivalent to - build clean - build - + mvn clean package site +

    - The build.bat batch file, or build.sh shell script (depending on - your operating system use ant and the buildfile build.xml. See + The mvnbuild.bat batch file, or mvnbuild.sh shell script (depending on + your operating system) use maven and the buildfiles pom.xml. See the section Using ant for more information.

    - Other useful targets may be xsltc.jar or serializer.jar. If you want to test the jars you just built in the directory java/build, change to - directory test and issue this command: + directory xalan-test and issue this command: - build jar - build smoketest + build jar extensions.classes + build smoketest The first target, jar builds the test harness and only needs to be done - once after the test repository is checked out. The second target, smoketest, + once after the test repository is checked out. + The second target builds plug-in extensions used to test that capability. + The third target, smoketest, runs the Xalan-J intepretive smoketest. Running the build smoketest or other targets in the test directory automatically looks for the jars in the directory ../java/build @@ -267,6 +274,10 @@ build completed! +

    + WARNING: THIS SECTION REFERS TO THE OLD ANT-BASED BUILD OF XALAN. + IT NEEDS TO BE REWRITTEN FOR MAVEN-BASED BUILD +

    If you have downloaded a source distribution, or obtained source code using subversion, this section may be of interest to you. diff --git a/xdocs/sources/xalan/dtm.xml b/stylebook/sources/xalan/dtm.xml similarity index 100% rename from xdocs/sources/xalan/dtm.xml rename to stylebook/sources/xalan/dtm.xml diff --git a/xdocs/sources/xalan/extensions.xml b/stylebook/sources/xalan/extensions.xml similarity index 100% rename from xdocs/sources/xalan/extensions.xml rename to stylebook/sources/xalan/extensions.xml diff --git a/xdocs/sources/xalan/extensions_xsltc.xml b/stylebook/sources/xalan/extensions_xsltc.xml similarity index 100% rename from xdocs/sources/xalan/extensions_xsltc.xml rename to stylebook/sources/xalan/extensions_xsltc.xml diff --git a/xdocs/sources/xalan/extensionslib.xml b/stylebook/sources/xalan/extensionslib.xml similarity index 100% rename from xdocs/sources/xalan/extensionslib.xml rename to stylebook/sources/xalan/extensionslib.xml diff --git a/xdocs/sources/xalan/faq.xml b/stylebook/sources/xalan/faq.xml similarity index 100% rename from xdocs/sources/xalan/faq.xml rename to stylebook/sources/xalan/faq.xml diff --git a/xdocs/sources/xalan/features.xml b/stylebook/sources/xalan/features.xml similarity index 100% rename from xdocs/sources/xalan/features.xml rename to stylebook/sources/xalan/features.xml diff --git a/xdocs/sources/xalan/getstarted.xml b/stylebook/sources/xalan/getstarted.xml similarity index 100% rename from xdocs/sources/xalan/getstarted.xml rename to stylebook/sources/xalan/getstarted.xml diff --git a/xdocs/sources/xalan/history.xml b/stylebook/sources/xalan/history.xml similarity index 99% rename from xdocs/sources/xalan/history.xml rename to stylebook/sources/xalan/history.xml index d39e0cbdc..cdcfa2beb 100644 --- a/xdocs/sources/xalan/history.xml +++ b/stylebook/sources/xalan/history.xml @@ -4798,7 +4798,7 @@ alternatives.

  • Committed by jkesselm@apache.org transforms so that when the transformer is reused, we were using nodesets from the previous transform which were using a different DTM. Note that we want keep any variables that have been set externally by the user (using -Transformer.setParameter()).

  • Committed by mmidy@apache.org on 01/28/2002
    Modified: java/src/org/apache/xpath/res XPATHErrorResources.java
    Committer's log entry: bug 4762: Fixed the duplicate error message in XPATH.

  • Committed by jkesselm@apache.org on 01/28/2002
    Modified: java/src/org/apache/xalan/transformer TransformerImpl.java
    Committer's log entry: Bugzilla 4054: Retain previously set output properties when adding new ones.

  • Committed by mmidy@apache.org on 01/28/2002
    Modified: java/src/org/apache/xalan/transformer TransformerImpl.java
    Committer's log entry: Bug 5872. We were using a constructor of TransformerException without the +Transformer.setParameter()).

  • Committed by mmidy@apache.org on 01/28/2002
    Modified: java/src/org/apache/xpath/res XPATHErrorResources.java
    Committer's log entry: bug 4762: Fixed the duplicate error message in XPATH.

  • Committed by jkesselm@apache.org on 01/28/2002
    Modified: java/src/org/apache/xalan/transformer TransformerImpl.java
    Committer's log entry: Bugzilla 4054: Retain previously set output properties when adding new ones.

  • Committed by mmidy@apache.org on 01/28/2002
    Modified: java/src/org/apache/xalan/transformer TransformerImpl.java
    Committer's log entry: Bug 5872. We were using a constructor of TransformerException without the locator information. Changed to code to use a locator if info is available.

  • Committed by dleslie@apache.org on 01/30/2002
    Modified: java/src/org/apache/xalan/lib NodeInfo.java
    Committer's log entry: Changed "system id" to "public identifier" in javadoc comments for publicId() methods.

  • Committed by jkesselm@apache.org on 01/30/2002
    Modified: java/src/org/apache/xml/dtm/ref/sax2dtm SAX2DTM.java
    Committer's log entry: Bugzilla 2617, part 1: Construct the data structures and access them correctly. diff --git a/xdocs/sources/xalan/index.xml b/stylebook/sources/xalan/index.xml similarity index 100% rename from xdocs/sources/xalan/index.xml rename to stylebook/sources/xalan/index.xml diff --git a/xdocs/sources/xalan/overview.xml b/stylebook/sources/xalan/overview.xml similarity index 100% rename from xdocs/sources/xalan/overview.xml rename to stylebook/sources/xalan/overview.xml diff --git a/xdocs/sources/xalan/public_apis.xml b/stylebook/sources/xalan/public_apis.xml similarity index 100% rename from xdocs/sources/xalan/public_apis.xml rename to stylebook/sources/xalan/public_apis.xml diff --git a/xdocs/sources/xalan/readme.xml b/stylebook/sources/xalan/readme.xml similarity index 100% rename from xdocs/sources/xalan/readme.xml rename to stylebook/sources/xalan/readme.xml diff --git a/xdocs/sources/xalan/resources.xml b/stylebook/sources/xalan/resources.xml similarity index 100% rename from xdocs/sources/xalan/resources.xml rename to stylebook/sources/xalan/resources.xml diff --git a/xdocs/sources/xalan/samples.xml b/stylebook/sources/xalan/samples.xml similarity index 100% rename from xdocs/sources/xalan/samples.xml rename to stylebook/sources/xalan/samples.xml diff --git a/xdocs/sources/xalan/trax.xml b/stylebook/sources/xalan/trax.xml similarity index 100% rename from xdocs/sources/xalan/trax.xml rename to stylebook/sources/xalan/trax.xml diff --git a/xdocs/sources/xalan/usagepatterns.xml b/stylebook/sources/xalan/usagepatterns.xml similarity index 100% rename from xdocs/sources/xalan/usagepatterns.xml rename to stylebook/sources/xalan/usagepatterns.xml diff --git a/xdocs/sources/xalan/whatsnew.xml b/stylebook/sources/xalan/whatsnew.xml similarity index 100% rename from xdocs/sources/xalan/whatsnew.xml rename to stylebook/sources/xalan/whatsnew.xml diff --git a/stylebook/sources/xalan/xalan-collate.xml b/stylebook/sources/xalan/xalan-collate.xml new file mode 100644 index 000000000..947ac93d7 --- /dev/null +++ b/stylebook/sources/xalan/xalan-collate.xml @@ -0,0 +1,107 @@ + +
      +
    • Introduction
    • +
    • Performance settings
    • +
    + +

    The Document Table Model (DTM) is an interface to a Document Model designed specifically for + the needs of our XPath and XSLT implementations. The motivation behind this model is to optimize + performance and minimize storage.

    +

    Specifically, DTM avoids the overhead of instantiating the objects the standard DOM requires to + represent a tree of nodes. DTM uses unique integer "handles" to identify nodes, integer ID values + to represent URLs, local names, and expanded names, and integer index and length references to a + string buffer to represent the text value of each node.

    +

    In general, the "read" APIs to DTM resemble those of the W3C Document Object Model + () interface. However, in place of the DOM object tree of nodes, DTM + uses integer arrays and string pools to represent the structure and content of the XML document to + be transformed. DTM also structures the document's contents slightly differently, to better match + the XPath data model; some details and constraints present in a standard DOM are suppressed, and a + few XPath-specific features are added.

    +

    DTM is intended to be a read-only model, and so does not attempt to replicate the DOM's write or + create-node operations.

    +

    The details of constructing a DTM vary depending on which implementation of this API you are + using. Two reference implementations are currently available:

    +
      +
    • SAX2DTM (built via a SAX stream)
    • +
    • DOM2DTM (which provides DTM access to an existing DOM)
    • +
    +

    Both DTMs can be built incrementally (see incremental transforms). + When operating incrementally, the DTM allows the Xalan-Java processor to begin reading the DTM and + performing the transformation while the DTM is still being assembled (for example, while the parser + is still parsing the XML source), and attempts to do only as much work as is needed to support the + read requests actually made by the XPath or XSLT processor.

    +

    For the convenience of user-written extensions, a proxy mechanism presents the contents of the + DTM as a read-only subset of the DOM.

    +
    + + + +

    Xalan-Java implements two DTM performance features that you can control with the TransformerFactory + setAttribute(String name, Object value) method.

    + + + + + + + + + + + + + + + + +
    Attribute name (URL)Default settingDescription
    "http://xml.apache.org/xalan/features/incremental"falseincremental transforms
    "http://xml.apache.org/xalan/features/optimize"trueoptimized transforms
    +

    Both of these DTM settings are described below.

    + +

    + + +

    Set this feature to true to enable incremental transformations. If set to false (the default), + the transform and the parse are performed on the same thread.

    + When set to true: If the parser is Xerces, we perform an incremental transform on a single + thread using the Xerces "parse on demand" feature. If the parser is not Xerces, we run the + transform in one thread and the parse in another. Exception: if the parser is not Xerces + and the XML source is a DOMSource, setting this feature to true has no effect. + The incremental feature is not currently supported by the XSLT Compiling processor, XSLTC. +

    Example: setting incremental transforms to true (for the XSLT Interpretive processor):

    + javax.xml.transform.TransformerFactory tFactory = + javax.xml.transform.TransformerFactory.newInstance(); + // setAttribute() takes a String and an Object. + tFactory.setAttribute + ("http://xml.apache.org/xalan/features/incremental", + java.lang.Boolean.TRUE); + ... +
    + + + +

    When set to true (the default), this feature enables optimizations that may involve structural + rewrites of the stylesheet. Any tool that requires direct access to the stylesheet structure + should set this feature to false.

    +
    +
    + + +

    The DTM also provides a setting that you can use to track location information for each node in + the source document. See "http://apache.org/xalan/features/source_location"

    +
    +
    \ No newline at end of file diff --git a/xdocs/sources/xalan/xmlfilters.gif b/stylebook/sources/xalan/xmlfilters.gif similarity index 100% rename from xdocs/sources/xalan/xmlfilters.gif rename to stylebook/sources/xalan/xmlfilters.gif diff --git a/xdocs/sources/xalan/xpath_apis.xml b/stylebook/sources/xalan/xpath_apis.xml similarity index 100% rename from xdocs/sources/xalan/xpath_apis.xml rename to stylebook/sources/xalan/xpath_apis.xml diff --git a/xdocs/sources/xalan/xsltc_history.xml b/stylebook/sources/xalan/xsltc_history.xml similarity index 100% rename from xdocs/sources/xalan/xsltc_history.xml rename to stylebook/sources/xalan/xsltc_history.xml diff --git a/xdocs/sources/xalan/xsltc_usage.xml b/stylebook/sources/xalan/xsltc_usage.xml similarity index 100% rename from xdocs/sources/xalan/xsltc_usage.xml rename to stylebook/sources/xalan/xsltc_usage.xml diff --git a/xdocs/sources/xalandesign.xml b/stylebook/sources/xalandesign.xml similarity index 100% rename from xdocs/sources/xalandesign.xml rename to stylebook/sources/xalandesign.xml diff --git a/xdocs/sources/xsltc.xml b/stylebook/sources/xsltc.xml similarity index 100% rename from xdocs/sources/xsltc.xml rename to stylebook/sources/xsltc.xml diff --git a/xdocs/sources/xsltc/DOMInterface.gif b/stylebook/sources/xsltc/DOMInterface.gif similarity index 100% rename from xdocs/sources/xsltc/DOMInterface.gif rename to stylebook/sources/xsltc/DOMInterface.gif diff --git a/xdocs/sources/xsltc/DOMLocking.gif b/stylebook/sources/xsltc/DOMLocking.gif similarity index 100% rename from xdocs/sources/xsltc/DOMLocking.gif rename to stylebook/sources/xsltc/DOMLocking.gif diff --git a/xdocs/sources/xsltc/README b/stylebook/sources/xsltc/README similarity index 100% rename from xdocs/sources/xsltc/README rename to stylebook/sources/xsltc/README diff --git a/xdocs/sources/xsltc/README.APACHE b/stylebook/sources/xsltc/README.APACHE similarity index 100% rename from xdocs/sources/xsltc/README.APACHE rename to stylebook/sources/xsltc/README.APACHE diff --git a/xdocs/sources/xsltc/README.api b/stylebook/sources/xsltc/README.api similarity index 100% rename from xdocs/sources/xsltc/README.api rename to stylebook/sources/xsltc/README.api diff --git a/xdocs/sources/xsltc/README.xslt b/stylebook/sources/xsltc/README.xslt similarity index 100% rename from xdocs/sources/xsltc/README.xslt rename to stylebook/sources/xsltc/README.xslt diff --git a/xdocs/sources/xsltc/README.xsltc b/stylebook/sources/xsltc/README.xsltc similarity index 100% rename from xdocs/sources/xsltc/README.xsltc rename to stylebook/sources/xsltc/README.xsltc diff --git a/xdocs/sources/xsltc/README2 b/stylebook/sources/xsltc/README2 similarity index 100% rename from xdocs/sources/xsltc/README2 rename to stylebook/sources/xsltc/README2 diff --git a/xdocs/sources/xsltc/all_namespaces.gif b/stylebook/sources/xsltc/all_namespaces.gif similarity index 100% rename from xdocs/sources/xsltc/all_namespaces.gif rename to stylebook/sources/xsltc/all_namespaces.gif diff --git a/xdocs/sources/xsltc/ast_stage1.gif b/stylebook/sources/xsltc/ast_stage1.gif similarity index 100% rename from xdocs/sources/xsltc/ast_stage1.gif rename to stylebook/sources/xsltc/ast_stage1.gif diff --git a/xdocs/sources/xsltc/ast_stage2.gif b/stylebook/sources/xsltc/ast_stage2.gif similarity index 100% rename from xdocs/sources/xsltc/ast_stage2.gif rename to stylebook/sources/xsltc/ast_stage2.gif diff --git a/xdocs/sources/xsltc/ast_stage3.gif b/stylebook/sources/xsltc/ast_stage3.gif similarity index 100% rename from xdocs/sources/xsltc/ast_stage3.gif rename to stylebook/sources/xsltc/ast_stage3.gif diff --git a/xdocs/sources/xsltc/cast_expression.gif b/stylebook/sources/xsltc/cast_expression.gif similarity index 100% rename from xdocs/sources/xsltc/cast_expression.gif rename to stylebook/sources/xsltc/cast_expression.gif diff --git a/xdocs/sources/xsltc/class_loader.gif b/stylebook/sources/xsltc/class_loader.gif similarity index 100% rename from xdocs/sources/xsltc/class_loader.gif rename to stylebook/sources/xsltc/class_loader.gif diff --git a/xdocs/sources/xsltc/compiler_AST.gif b/stylebook/sources/xsltc/compiler_AST.gif similarity index 100% rename from xdocs/sources/xsltc/compiler_AST.gif rename to stylebook/sources/xsltc/compiler_AST.gif diff --git a/xdocs/sources/xsltc/compiler_DOM.gif b/stylebook/sources/xsltc/compiler_DOM.gif similarity index 100% rename from xdocs/sources/xsltc/compiler_DOM.gif rename to stylebook/sources/xsltc/compiler_DOM.gif diff --git a/xdocs/sources/xsltc/compiler_architecture.gif b/stylebook/sources/xsltc/compiler_architecture.gif similarity index 100% rename from xdocs/sources/xsltc/compiler_architecture.gif rename to stylebook/sources/xsltc/compiler_architecture.gif diff --git a/xdocs/sources/xsltc/compiler_design.gif b/stylebook/sources/xsltc/compiler_design.gif similarity index 100% rename from xdocs/sources/xsltc/compiler_design.gif rename to stylebook/sources/xsltc/compiler_design.gif diff --git a/xdocs/sources/xsltc/dom_namespace1.gif b/stylebook/sources/xsltc/dom_namespace1.gif similarity index 100% rename from xdocs/sources/xsltc/dom_namespace1.gif rename to stylebook/sources/xsltc/dom_namespace1.gif diff --git a/xdocs/sources/xsltc/dom_namespace2.gif b/stylebook/sources/xsltc/dom_namespace2.gif similarity index 100% rename from xdocs/sources/xsltc/dom_namespace2.gif rename to stylebook/sources/xsltc/dom_namespace2.gif diff --git a/xdocs/sources/xsltc/dom_namespace3.gif b/stylebook/sources/xsltc/dom_namespace3.gif similarity index 100% rename from xdocs/sources/xsltc/dom_namespace3.gif rename to stylebook/sources/xsltc/dom_namespace3.gif diff --git a/xdocs/sources/xsltc/index.xml b/stylebook/sources/xsltc/index.xml similarity index 100% rename from xdocs/sources/xsltc/index.xml rename to stylebook/sources/xsltc/index.xml diff --git a/xdocs/sources/xsltc/iterator_stack.gif b/stylebook/sources/xsltc/iterator_stack.gif similarity index 100% rename from xdocs/sources/xsltc/iterator_stack.gif rename to stylebook/sources/xsltc/iterator_stack.gif diff --git a/xdocs/sources/xsltc/key_relations.gif b/stylebook/sources/xsltc/key_relations.gif similarity index 100% rename from xdocs/sources/xsltc/key_relations.gif rename to stylebook/sources/xsltc/key_relations.gif diff --git a/xdocs/sources/xsltc/match_namespace1.gif b/stylebook/sources/xsltc/match_namespace1.gif similarity index 100% rename from xdocs/sources/xsltc/match_namespace1.gif rename to stylebook/sources/xsltc/match_namespace1.gif diff --git a/xdocs/sources/xsltc/match_namespace2.gif b/stylebook/sources/xsltc/match_namespace2.gif similarity index 100% rename from xdocs/sources/xsltc/match_namespace2.gif rename to stylebook/sources/xsltc/match_namespace2.gif diff --git a/xdocs/sources/xsltc/namespace_stack.gif b/stylebook/sources/xsltc/namespace_stack.gif similarity index 100% rename from xdocs/sources/xsltc/namespace_stack.gif rename to stylebook/sources/xsltc/namespace_stack.gif diff --git a/xdocs/sources/xsltc/output_namespaces1.gif b/stylebook/sources/xsltc/output_namespaces1.gif similarity index 100% rename from xdocs/sources/xsltc/output_namespaces1.gif rename to stylebook/sources/xsltc/output_namespaces1.gif diff --git a/xdocs/sources/xsltc/output_namespaces2.gif b/stylebook/sources/xsltc/output_namespaces2.gif similarity index 100% rename from xdocs/sources/xsltc/output_namespaces2.gif rename to stylebook/sources/xsltc/output_namespaces2.gif diff --git a/xdocs/sources/xsltc/output_settings.gif b/stylebook/sources/xsltc/output_settings.gif similarity index 100% rename from xdocs/sources/xsltc/output_settings.gif rename to stylebook/sources/xsltc/output_settings.gif diff --git a/xdocs/sources/xsltc/overall_design.gif b/stylebook/sources/xsltc/overall_design.gif similarity index 100% rename from xdocs/sources/xsltc/overall_design.gif rename to stylebook/sources/xsltc/overall_design.gif diff --git a/xdocs/sources/xsltc/pattern_objects.gif b/stylebook/sources/xsltc/pattern_objects.gif similarity index 100% rename from xdocs/sources/xsltc/pattern_objects.gif rename to stylebook/sources/xsltc/pattern_objects.gif diff --git a/xdocs/sources/xsltc/runtime_architecture.gif b/stylebook/sources/xsltc/runtime_architecture.gif similarity index 100% rename from xdocs/sources/xsltc/runtime_architecture.gif rename to stylebook/sources/xsltc/runtime_architecture.gif diff --git a/xdocs/sources/xsltc/runtime_design.gif b/stylebook/sources/xsltc/runtime_design.gif similarity index 100% rename from xdocs/sources/xsltc/runtime_design.gif rename to stylebook/sources/xsltc/runtime_design.gif diff --git a/xdocs/sources/xsltc/runtime_type_mapping.gif b/stylebook/sources/xsltc/runtime_type_mapping.gif similarity index 100% rename from xdocs/sources/xsltc/runtime_type_mapping.gif rename to stylebook/sources/xsltc/runtime_type_mapping.gif diff --git a/xdocs/sources/xsltc/sort_objects.gif b/stylebook/sources/xsltc/sort_objects.gif similarity index 100% rename from xdocs/sources/xsltc/sort_objects.gif rename to stylebook/sources/xsltc/sort_objects.gif diff --git a/xdocs/sources/xsltc/translet_wrapping.gif b/stylebook/sources/xsltc/translet_wrapping.gif similarity index 100% rename from xdocs/sources/xsltc/translet_wrapping.gif rename to stylebook/sources/xsltc/translet_wrapping.gif diff --git a/xdocs/sources/xsltc/trax_output_settings.gif b/stylebook/sources/xsltc/trax_output_settings.gif similarity index 100% rename from xdocs/sources/xsltc/trax_output_settings.gif rename to stylebook/sources/xsltc/trax_output_settings.gif diff --git a/xdocs/sources/xsltc/trax_translet_wrapping.gif b/stylebook/sources/xsltc/trax_translet_wrapping.gif similarity index 100% rename from xdocs/sources/xsltc/trax_translet_wrapping.gif rename to stylebook/sources/xsltc/trax_translet_wrapping.gif diff --git a/xdocs/sources/xsltc/type_mapping.gif b/stylebook/sources/xsltc/type_mapping.gif similarity index 100% rename from xdocs/sources/xsltc/type_mapping.gif rename to stylebook/sources/xsltc/type_mapping.gif diff --git a/xdocs/sources/xsltc/type_mappings.gif b/stylebook/sources/xsltc/type_mappings.gif similarity index 100% rename from xdocs/sources/xsltc/type_mappings.gif rename to stylebook/sources/xsltc/type_mappings.gif diff --git a/xdocs/sources/xsltc/typecast.gif b/stylebook/sources/xsltc/typecast.gif similarity index 100% rename from xdocs/sources/xsltc/typecast.gif rename to stylebook/sources/xsltc/typecast.gif diff --git a/xdocs/sources/xsltc/uri_resolver.gif b/stylebook/sources/xsltc/uri_resolver.gif similarity index 100% rename from xdocs/sources/xsltc/uri_resolver.gif rename to stylebook/sources/xsltc/uri_resolver.gif diff --git a/xdocs/sources/xsltc/xsl_choose_design.xml b/stylebook/sources/xsltc/xsl_choose_design.xml similarity index 100% rename from xdocs/sources/xsltc/xsl_choose_design.xml rename to stylebook/sources/xsltc/xsl_choose_design.xml diff --git a/xdocs/sources/xsltc/xsl_comment_design.xml b/stylebook/sources/xsltc/xsl_comment_design.xml similarity index 100% rename from xdocs/sources/xsltc/xsl_comment_design.xml rename to stylebook/sources/xsltc/xsl_comment_design.xml diff --git a/xdocs/sources/xsltc/xsl_if_design.xml b/stylebook/sources/xsltc/xsl_if_design.xml similarity index 100% rename from xdocs/sources/xsltc/xsl_if_design.xml rename to stylebook/sources/xsltc/xsl_if_design.xml diff --git a/xdocs/sources/xsltc/xsl_include_design.xml b/stylebook/sources/xsltc/xsl_include_design.xml similarity index 100% rename from xdocs/sources/xsltc/xsl_include_design.xml rename to stylebook/sources/xsltc/xsl_include_design.xml diff --git a/xdocs/sources/xsltc/xsl_key_design.xml b/stylebook/sources/xsltc/xsl_key_design.xml similarity index 100% rename from xdocs/sources/xsltc/xsl_key_design.xml rename to stylebook/sources/xsltc/xsl_key_design.xml diff --git a/xdocs/sources/xsltc/xsl_lang_design.xml b/stylebook/sources/xsltc/xsl_lang_design.xml similarity index 100% rename from xdocs/sources/xsltc/xsl_lang_design.xml rename to stylebook/sources/xsltc/xsl_lang_design.xml diff --git a/xdocs/sources/xsltc/xsl_sort_design.xml b/stylebook/sources/xsltc/xsl_sort_design.xml similarity index 100% rename from xdocs/sources/xsltc/xsl_sort_design.xml rename to stylebook/sources/xsltc/xsl_sort_design.xml diff --git a/xdocs/sources/xsltc/xsl_unparsed_design.xml b/stylebook/sources/xsltc/xsl_unparsed_design.xml similarity index 100% rename from xdocs/sources/xsltc/xsl_unparsed_design.xml rename to stylebook/sources/xsltc/xsl_unparsed_design.xml diff --git a/xdocs/sources/xsltc/xsl_variable_design.xml b/stylebook/sources/xsltc/xsl_variable_design.xml similarity index 100% rename from xdocs/sources/xsltc/xsl_variable_design.xml rename to stylebook/sources/xsltc/xsl_variable_design.xml diff --git a/xdocs/sources/xsltc/xsl_whitespace_design.xml b/stylebook/sources/xsltc/xsl_whitespace_design.xml similarity index 100% rename from xdocs/sources/xsltc/xsl_whitespace_design.xml rename to stylebook/sources/xsltc/xsl_whitespace_design.xml diff --git a/xdocs/sources/xsltc/xsltc_compiler.xml b/stylebook/sources/xsltc/xsltc_compiler.xml similarity index 100% rename from xdocs/sources/xsltc/xsltc_compiler.xml rename to stylebook/sources/xsltc/xsltc_compiler.xml diff --git a/xdocs/sources/xsltc/xsltc_dom.xml b/stylebook/sources/xsltc/xsltc_dom.xml similarity index 100% rename from xdocs/sources/xsltc/xsltc_dom.xml rename to stylebook/sources/xsltc/xsltc_dom.xml diff --git a/xdocs/sources/xsltc/xsltc_iterators.xml b/stylebook/sources/xsltc/xsltc_iterators.xml similarity index 100% rename from xdocs/sources/xsltc/xsltc_iterators.xml rename to stylebook/sources/xsltc/xsltc_iterators.xml diff --git a/xdocs/sources/xsltc/xsltc_namespace.xml b/stylebook/sources/xsltc/xsltc_namespace.xml similarity index 100% rename from xdocs/sources/xsltc/xsltc_namespace.xml rename to stylebook/sources/xsltc/xsltc_namespace.xml diff --git a/xdocs/sources/xsltc/xsltc_native_api.xml b/stylebook/sources/xsltc/xsltc_native_api.xml similarity index 100% rename from xdocs/sources/xsltc/xsltc_native_api.xml rename to stylebook/sources/xsltc/xsltc_native_api.xml diff --git a/xdocs/sources/xsltc/xsltc_overview.xml b/stylebook/sources/xsltc/xsltc_overview.xml similarity index 100% rename from xdocs/sources/xsltc/xsltc_overview.xml rename to stylebook/sources/xsltc/xsltc_overview.xml diff --git a/xdocs/sources/xsltc/xsltc_performance.xml b/stylebook/sources/xsltc/xsltc_performance.xml similarity index 100% rename from xdocs/sources/xsltc/xsltc_performance.xml rename to stylebook/sources/xsltc/xsltc_performance.xml diff --git a/xdocs/sources/xsltc/xsltc_predicates.xml b/stylebook/sources/xsltc/xsltc_predicates.xml similarity index 100% rename from xdocs/sources/xsltc/xsltc_predicates.xml rename to stylebook/sources/xsltc/xsltc_predicates.xml diff --git a/xdocs/sources/xsltc/xsltc_runtime.xml b/stylebook/sources/xsltc/xsltc_runtime.xml similarity index 100% rename from xdocs/sources/xsltc/xsltc_runtime.xml rename to stylebook/sources/xsltc/xsltc_runtime.xml diff --git a/xdocs/sources/xsltc/xsltc_trax.xml b/stylebook/sources/xsltc/xsltc_trax.xml similarity index 100% rename from xdocs/sources/xsltc/xsltc_trax.xml rename to stylebook/sources/xsltc/xsltc_trax.xml diff --git a/xdocs/sources/xsltc/xsltc_trax_api.xml b/stylebook/sources/xsltc/xsltc_trax_api.xml similarity index 100% rename from xdocs/sources/xsltc/xsltc_trax_api.xml rename to stylebook/sources/xsltc/xsltc_trax_api.xml diff --git a/stylebook/style/dtd/blocks.ent b/stylebook/style/dtd/blocks.ent new file mode 100644 index 000000000..5f352d1bf --- /dev/null +++ b/stylebook/style/dtd/blocks.ent @@ -0,0 +1,40 @@ + + + + + + + +%markupEntity; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/stylebook/style/dtd/book.dtd b/stylebook/style/dtd/book.dtd new file mode 100644 index 000000000..2f49ce990 --- /dev/null +++ b/stylebook/style/dtd/book.dtd @@ -0,0 +1,49 @@ + + + + + + +%externalEntity; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/stylebook/style/dtd/changes.dtd b/stylebook/style/dtd/changes.dtd new file mode 100644 index 000000000..661affa86 --- /dev/null +++ b/stylebook/style/dtd/changes.dtd @@ -0,0 +1,24 @@ + + + + + + +%markupEntity; + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/stylebook/style/dtd/characters.ent b/stylebook/style/dtd/characters.ent new file mode 100644 index 000000000..036c06d5e --- /dev/null +++ b/stylebook/style/dtd/characters.ent @@ -0,0 +1,297 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/stylebook/style/dtd/document.dtd b/stylebook/style/dtd/document.dtd new file mode 100644 index 000000000..f7cf5b121 --- /dev/null +++ b/stylebook/style/dtd/document.dtd @@ -0,0 +1,19 @@ + + + + + + +%blocksEntity; + + + + + + + + + + + + \ No newline at end of file diff --git a/stylebook/style/dtd/faqs.dtd b/stylebook/style/dtd/faqs.dtd new file mode 100644 index 000000000..565d99f4b --- /dev/null +++ b/stylebook/style/dtd/faqs.dtd @@ -0,0 +1,19 @@ + + + + + + +%blocksEntity; + + + + + + + + + + + + \ No newline at end of file diff --git a/stylebook/style/dtd/links.ent b/stylebook/style/dtd/links.ent new file mode 100644 index 000000000..63b002fff --- /dev/null +++ b/stylebook/style/dtd/links.ent @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/stylebook/style/dtd/markup.ent b/stylebook/style/dtd/markup.ent new file mode 100644 index 000000000..66319e5f7 --- /dev/null +++ b/stylebook/style/dtd/markup.ent @@ -0,0 +1,21 @@ + + + + + + + +%externalEntity; + + +%charEntity; + + +%linksEntity; + + + + + + + \ No newline at end of file diff --git a/stylebook/style/dtd/spec.dtd b/stylebook/style/dtd/spec.dtd new file mode 100644 index 000000000..260c80fc5 --- /dev/null +++ b/stylebook/style/dtd/spec.dtd @@ -0,0 +1,593 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/stylebook/style/dtd/xsl-html40s.dtd b/stylebook/style/dtd/xsl-html40s.dtd new file mode 100644 index 000000000..611f56e0f --- /dev/null +++ b/stylebook/style/dtd/xsl-html40s.dtd @@ -0,0 +1,1520 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/stylebook/style/graphics/button-a.gif b/stylebook/style/graphics/button-a.gif new file mode 100644 index 000000000..5d0b8c242 Binary files /dev/null and b/stylebook/style/graphics/button-a.gif differ diff --git a/stylebook/style/graphics/button-b.gif b/stylebook/style/graphics/button-b.gif new file mode 100644 index 000000000..06e03811a Binary files /dev/null and b/stylebook/style/graphics/button-b.gif differ diff --git a/stylebook/style/loader.xml b/stylebook/style/loader.xml new file mode 100644 index 000000000..8607e5d7c --- /dev/null +++ b/stylebook/style/loader.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/stylebook/style/loaderdesign.xml b/stylebook/style/loaderdesign.xml new file mode 100644 index 000000000..975055b39 --- /dev/null +++ b/stylebook/style/loaderdesign.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/stylebook/style/resources/bottom.gif b/stylebook/style/resources/bottom.gif new file mode 100644 index 000000000..f39031efa Binary files /dev/null and b/stylebook/style/resources/bottom.gif differ diff --git a/stylebook/style/resources/button-asf-hi.gif b/stylebook/style/resources/button-asf-hi.gif new file mode 100644 index 000000000..08b880a74 Binary files /dev/null and b/stylebook/style/resources/button-asf-hi.gif differ diff --git a/stylebook/style/resources/button-asf-lo.gif b/stylebook/style/resources/button-asf-lo.gif new file mode 100644 index 000000000..134580f37 Binary files /dev/null and b/stylebook/style/resources/button-asf-lo.gif differ diff --git a/stylebook/style/resources/button-w3c-hi.gif b/stylebook/style/resources/button-w3c-hi.gif new file mode 100644 index 000000000..3bf0be395 Binary files /dev/null and b/stylebook/style/resources/button-w3c-hi.gif differ diff --git a/stylebook/style/resources/button-w3c-lo.gif b/stylebook/style/resources/button-w3c-lo.gif new file mode 100644 index 000000000..d383d3dd9 Binary files /dev/null and b/stylebook/style/resources/button-w3c-lo.gif differ diff --git a/stylebook/style/resources/button-xml-hi.gif b/stylebook/style/resources/button-xml-hi.gif new file mode 100644 index 000000000..01d095ce4 Binary files /dev/null and b/stylebook/style/resources/button-xml-hi.gif differ diff --git a/stylebook/style/resources/button-xml-lo.gif b/stylebook/style/resources/button-xml-lo.gif new file mode 100644 index 000000000..5719c7ef0 Binary files /dev/null and b/stylebook/style/resources/button-xml-lo.gif differ diff --git a/stylebook/style/resources/close.gif b/stylebook/style/resources/close.gif new file mode 100644 index 000000000..48a9782ce Binary files /dev/null and b/stylebook/style/resources/close.gif differ diff --git a/stylebook/style/resources/dot.gif b/stylebook/style/resources/dot.gif new file mode 100644 index 000000000..6227d1d86 Binary files /dev/null and b/stylebook/style/resources/dot.gif differ diff --git a/stylebook/style/resources/join.gif b/stylebook/style/resources/join.gif new file mode 100644 index 000000000..02e7611bb Binary files /dev/null and b/stylebook/style/resources/join.gif differ diff --git a/stylebook/style/resources/line.gif b/stylebook/style/resources/line.gif new file mode 100644 index 000000000..fd25c3943 Binary files /dev/null and b/stylebook/style/resources/line.gif differ diff --git a/stylebook/style/resources/logo.gif b/stylebook/style/resources/logo.gif new file mode 100644 index 000000000..53538c3f6 Binary files /dev/null and b/stylebook/style/resources/logo.gif differ diff --git a/stylebook/style/resources/note.gif b/stylebook/style/resources/note.gif new file mode 100644 index 000000000..339422266 Binary files /dev/null and b/stylebook/style/resources/note.gif differ diff --git a/stylebook/style/resources/right.gif b/stylebook/style/resources/right.gif new file mode 100644 index 000000000..bcb50e386 Binary files /dev/null and b/stylebook/style/resources/right.gif differ diff --git a/stylebook/style/resources/script.js b/stylebook/style/resources/script.js new file mode 100644 index 000000000..2f89588ff --- /dev/null +++ b/stylebook/style/resources/script.js @@ -0,0 +1,21 @@ +rolloverImagesOn=new Array(); +rolloverImagesOff=new Array(); + +function rolloverOn(name) { + if(rolloverImagesOn[name]){ + document.images[name].src=rolloverImagesOn[name].src; + } +} + +function rolloverOff(name) { + if(rolloverImagesOff[name]){ + document.images[name].src=rolloverImagesOff[name].src; + } +} + +function rolloverLoad(name,on,off) { + rolloverImagesOn[name]=new Image(); + rolloverImagesOn[name].src=on; + rolloverImagesOff[name]=new Image(); + rolloverImagesOff[name].src=off; +} diff --git a/stylebook/style/resources/separator.gif b/stylebook/style/resources/separator.gif new file mode 100644 index 000000000..e7749432f Binary files /dev/null and b/stylebook/style/resources/separator.gif differ diff --git a/stylebook/style/resources/void.gif b/stylebook/style/resources/void.gif new file mode 100644 index 000000000..75b945d25 Binary files /dev/null and b/stylebook/style/resources/void.gif differ diff --git a/stylebook/style/stylesheets/any2header.xsl b/stylebook/style/stylesheets/any2header.xsl new file mode 100644 index 000000000..51a8e5a04 --- /dev/null +++ b/stylebook/style/stylesheets/any2header.xsl @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/stylebook/style/stylesheets/any2project.xsl b/stylebook/style/stylesheets/any2project.xsl new file mode 100644 index 000000000..2a29c06f5 --- /dev/null +++ b/stylebook/style/stylesheets/any2project.xsl @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/stylebook/style/stylesheets/book2group.xsl b/stylebook/style/stylesheets/book2group.xsl new file mode 100644 index 000000000..34ac963e8 --- /dev/null +++ b/stylebook/style/stylesheets/book2group.xsl @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/stylebook/style/stylesheets/book2project.xsl b/stylebook/style/stylesheets/book2project.xsl new file mode 100644 index 000000000..41d34e2a9 --- /dev/null +++ b/stylebook/style/stylesheets/book2project.xsl @@ -0,0 +1,257 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/stylebook/style/stylesheets/changes2document.xsl b/stylebook/style/stylesheets/changes2document.xsl new file mode 100644 index 000000000..dccbcfce7 --- /dev/null +++ b/stylebook/style/stylesheets/changes2document.xsl @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + +
  • + + + + + + + + + \ No newline at end of file diff --git a/stylebook/style/stylesheets/context2footer.xsl b/stylebook/style/stylesheets/context2footer.xsl new file mode 100644 index 000000000..f50cdf2f9 --- /dev/null +++ b/stylebook/style/stylesheets/context2footer.xsl @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/stylebook/style/stylesheets/context2label.xsl b/stylebook/style/stylesheets/context2label.xsl new file mode 100644 index 000000000..3c25e5217 --- /dev/null +++ b/stylebook/style/stylesheets/context2label.xsl @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/xdocs/style/stylesheets/design2project.xsl b/stylebook/style/stylesheets/design2project.xsl similarity index 100% rename from xdocs/style/stylesheets/design2project.xsl rename to stylebook/style/stylesheets/design2project.xsl diff --git a/xdocs/style/stylesheets/designdoc2html.xsl b/stylebook/style/stylesheets/designdoc2html.xsl similarity index 100% rename from xdocs/style/stylesheets/designdoc2html.xsl rename to stylebook/style/stylesheets/designdoc2html.xsl diff --git a/stylebook/style/stylesheets/directory2project.xsl b/stylebook/style/stylesheets/directory2project.xsl new file mode 100644 index 000000000..48a4581c8 --- /dev/null +++ b/stylebook/style/stylesheets/directory2project.xsl @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/stylebook/style/stylesheets/document2html.xsl b/stylebook/style/stylesheets/document2html.xsl new file mode 100644 index 000000000..1c2de8f20 --- /dev/null +++ b/stylebook/style/stylesheets/document2html.xsl @@ -0,0 +1,445 @@ + + + + + + + + + + + + + + + + + +
    +

     Transform XML Document

    + + + + + + + + + + + + +
    Document to transformDisplay output as
    + + + HTML   + HTML Source +      + +
    +
    + + + + + + + diff --git a/xalansamples/src/site/xhtml/AppletXMLtoHTML/target.xhtml b/xalansamples/src/site/xhtml/AppletXMLtoHTML/target.xhtml new file mode 100644 index 000000000..f3caa0617 --- /dev/null +++ b/xalansamples/src/site/xhtml/AppletXMLtoHTML/target.xhtml @@ -0,0 +1,24 @@ + + + + + Untitled + +   + diff --git a/samples/translets/readme.html b/xalansamples/src/site/xhtml/ApplyXPath/readme.xhtml similarity index 100% rename from samples/translets/readme.html rename to xalansamples/src/site/xhtml/ApplyXPath/readme.xhtml diff --git a/xalansamples/src/site/xhtml/ApplyXPathDOM/readme.xhtml b/xalansamples/src/site/xhtml/ApplyXPathDOM/readme.xhtml new file mode 100644 index 000000000..415137e63 --- /dev/null +++ b/xalansamples/src/site/xhtml/ApplyXPathDOM/readme.xhtml @@ -0,0 +1,30 @@ + + + + + + Xalan Samples + + +

    Xalan Samples

    +

    For information about the samples (what they illustrate and how to run them), see Samples.

    + + + + diff --git a/xalansamples/src/site/xhtml/DOM2DOM/readme.xhtml b/xalansamples/src/site/xhtml/DOM2DOM/readme.xhtml new file mode 100644 index 000000000..415137e63 --- /dev/null +++ b/xalansamples/src/site/xhtml/DOM2DOM/readme.xhtml @@ -0,0 +1,30 @@ + + + + + + Xalan Samples + + +

    Xalan Samples

    +

    For information about the samples (what they illustrate and how to run them), see Samples.

    + + + + diff --git a/xalansamples/src/site/xhtml/Pipe/readme.xhtml b/xalansamples/src/site/xhtml/Pipe/readme.xhtml new file mode 100644 index 000000000..415137e63 --- /dev/null +++ b/xalansamples/src/site/xhtml/Pipe/readme.xhtml @@ -0,0 +1,30 @@ + + + + + + Xalan Samples + + +

    Xalan Samples

    +

    For information about the samples (what they illustrate and how to run them), see Samples.

    + + + + diff --git a/xalansamples/src/site/xhtml/SimpleTransform/readme.xhtml b/xalansamples/src/site/xhtml/SimpleTransform/readme.xhtml new file mode 100644 index 000000000..415137e63 --- /dev/null +++ b/xalansamples/src/site/xhtml/SimpleTransform/readme.xhtml @@ -0,0 +1,30 @@ + + + + + + Xalan Samples + + +

    Xalan Samples

    +

    For information about the samples (what they illustrate and how to run them), see Samples.

    + + + + diff --git a/xalansamples/src/site/xhtml/UseStylesheetParam/readme.xhtml b/xalansamples/src/site/xhtml/UseStylesheetParam/readme.xhtml new file mode 100644 index 000000000..415137e63 --- /dev/null +++ b/xalansamples/src/site/xhtml/UseStylesheetParam/readme.xhtml @@ -0,0 +1,30 @@ + + + + + + Xalan Samples + + +

    Xalan Samples

    +

    For information about the samples (what they illustrate and how to run them), see Samples.

    + + + + diff --git a/xalansamples/src/site/xhtml/UseXMLFilters/readme.xhtml b/xalansamples/src/site/xhtml/UseXMLFilters/readme.xhtml new file mode 100644 index 000000000..415137e63 --- /dev/null +++ b/xalansamples/src/site/xhtml/UseXMLFilters/readme.xhtml @@ -0,0 +1,30 @@ + + + + + + Xalan Samples + + +

    Xalan Samples

    +

    For information about the samples (what they illustrate and how to run them), see Samples.

    + + + + diff --git a/xalansamples/src/site/xhtml/Validate/readme.xhtml b/xalansamples/src/site/xhtml/Validate/readme.xhtml new file mode 100644 index 000000000..415137e63 --- /dev/null +++ b/xalansamples/src/site/xhtml/Validate/readme.xhtml @@ -0,0 +1,30 @@ + + + + + + Xalan Samples + + +

    Xalan Samples

    +

    For information about the samples (what they illustrate and how to run them), see Samples.

    + + + + diff --git a/xalansamples/src/site/xhtml/extensions/readme.xhtml b/xalansamples/src/site/xhtml/extensions/readme.xhtml new file mode 100644 index 000000000..415137e63 --- /dev/null +++ b/xalansamples/src/site/xhtml/extensions/readme.xhtml @@ -0,0 +1,30 @@ + + + + + + Xalan Samples + + +

    Xalan Samples

    +

    For information about the samples (what they illustrate and how to run them), see Samples.

    + + + + diff --git a/xalansamples/src/site/xhtml/extensions/sql/basic-connection/readme.xhtml b/xalansamples/src/site/xhtml/extensions/sql/basic-connection/readme.xhtml new file mode 100644 index 000000000..b7b4fb7b8 --- /dev/null +++ b/xalansamples/src/site/xhtml/extensions/sql/basic-connection/readme.xhtml @@ -0,0 +1,30 @@ + + + + + + Xalan Samples + + +

    Xalan Samples

    +

    For information about the samples (what they illustrate and how to run them), see Samples.

    + + + + diff --git a/xalansamples/src/site/xhtml/extensions/sql/extConnection/readme.xhtml b/xalansamples/src/site/xhtml/extensions/sql/extConnection/readme.xhtml new file mode 100644 index 000000000..b7b4fb7b8 --- /dev/null +++ b/xalansamples/src/site/xhtml/extensions/sql/extConnection/readme.xhtml @@ -0,0 +1,30 @@ + + + + + + Xalan Samples + + +

    Xalan Samples

    +

    For information about the samples (what they illustrate and how to run them), see Samples.

    + + + + diff --git a/xalansamples/src/site/xhtml/extensions/sql/pquery/readme.xhtml b/xalansamples/src/site/xhtml/extensions/sql/pquery/readme.xhtml new file mode 100644 index 000000000..b7b4fb7b8 --- /dev/null +++ b/xalansamples/src/site/xhtml/extensions/sql/pquery/readme.xhtml @@ -0,0 +1,30 @@ + + + + + + Xalan Samples + + +

    Xalan Samples

    +

    For information about the samples (what they illustrate and how to run them), see Samples.

    + + + + diff --git a/xalansamples/src/site/xhtml/extensions/sql/readme.xhtml b/xalansamples/src/site/xhtml/extensions/sql/readme.xhtml new file mode 100644 index 000000000..dff6155a7 --- /dev/null +++ b/xalansamples/src/site/xhtml/extensions/sql/readme.xhtml @@ -0,0 +1,30 @@ + + + + + + Xalan Samples + + +

    Xalan Samples

    +

    For information about the samples (what they illustrate and how to run them), see Samples.

    + + + + diff --git a/xalansamples/src/site/xhtml/extensions/sql/show-error/readme.xhtml b/xalansamples/src/site/xhtml/extensions/sql/show-error/readme.xhtml new file mode 100644 index 000000000..b7b4fb7b8 --- /dev/null +++ b/xalansamples/src/site/xhtml/extensions/sql/show-error/readme.xhtml @@ -0,0 +1,30 @@ + + + + + + Xalan Samples + + +

    Xalan Samples

    +

    For information about the samples (what they illustrate and how to run them), see Samples.

    + + + + diff --git a/xalansamples/src/site/xhtml/extensions/sql/streamable/readme.xhtml b/xalansamples/src/site/xhtml/extensions/sql/streamable/readme.xhtml new file mode 100644 index 000000000..b7b4fb7b8 --- /dev/null +++ b/xalansamples/src/site/xhtml/extensions/sql/streamable/readme.xhtml @@ -0,0 +1,30 @@ + + + + + + Xalan Samples + + +

    Xalan Samples

    +

    For information about the samples (what they illustrate and how to run them), see Samples.

    + + + + diff --git a/xalansamples/src/site/xhtml/translets/readme.xhtml b/xalansamples/src/site/xhtml/translets/readme.xhtml new file mode 100644 index 000000000..415137e63 --- /dev/null +++ b/xalansamples/src/site/xhtml/translets/readme.xhtml @@ -0,0 +1,30 @@ + + + + + + Xalan Samples + + +

    Xalan Samples

    +

    For information about the samples (what they illustrate and how to run them), see Samples.

    + + + + diff --git a/xalanservlet/pom.xml b/xalanservlet/pom.xml new file mode 100644 index 000000000..f6e35e1d8 --- /dev/null +++ b/xalanservlet/pom.xml @@ -0,0 +1,141 @@ + + + + 4.0.0 + + xalan-j + xalan + 2.7.3 + + + xalanservlet + Apache Xalan-Java Servlet Sample + war + + http://www.example.com + + + UTF-8 + 1.8 + 1.8 + + + + + + xalan + serializer + + + xalan + xalan + + + + xalan + ${xalan.taglet.artifactId} + provided + + + + + javax.servlet + servlet-api + 2.5 + provided + + + + + javax.ejb + ejb-api + 3.0 + provided + + + + + xerces + xercesImpl + 2.12.2 + provided + + + + + dev.aspectj + sunlabs.brazil + 2.3.1 + + + + + org.jboss.spec.javax.rmi + jboss-rmi-api_1.0_spec + 1.0.6.Final + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + + + + + create-javadocs + + + [1,) + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + + create-sources + + + [1,) + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + + + diff --git a/samples/servlet/ApplyXSLT.java b/xalanservlet/src/main/java/servlet/ApplyXSLT.java similarity index 83% rename from samples/servlet/ApplyXSLT.java rename to xalanservlet/src/main/java/servlet/ApplyXSLT.java index 50c4d8070..e326a6758 100644 --- a/samples/servlet/ApplyXSLT.java +++ b/xalanservlet/src/main/java/servlet/ApplyXSLT.java @@ -107,30 +107,30 @@ public void init(ServletConfig config) super.init(config); // If the server.root property --see above-- is null, use current working directory // as default location for media.properties. - if (ROOT != null){ + if (ROOT != null) { CURRENTDIR= getServletContext().getRealPath("/WEB-INF/classes/servlet/") + FS; - System.out.println ( CURRENTDIR);} + System.out.println ( CURRENTDIR); + } else CURRENTDIR = System.getProperty("user.dir")+ FS; - - setDefaultParameters(config); - - setMediaProps(config.getInitParameter("mediaURL")); + + setDefaultParameters(config); + setMediaProps(config.getInitParameter("mediaURL")); } - + /** * Sets the default parameters for the servlet from the configuration. - * Also sets required system properties until we figure out why servlet - * sometimess fails to read properties from properties files. + * Also sets required system properties until we figure out why servlet + * sometimes fails to read properties from properties files. * @param config Configuration */ protected void setDefaultParameters(ServletConfig config) { ourDefaultParameters = new DefaultApplyXSLTProperties(config); } - + /** - * Loads the media properties file specified by the given string. + * Loads the media properties file specified by the given string. * @param mediaURLstring Location of the media properties file. Can be either a full URL or a path relative * to the System's server.root /servlets directory. If this parameter is null, * server.root/servlets/media.properties will be used. @@ -190,7 +190,7 @@ public String getMedia(HttpServletRequest request) { return ourMediaProps.getValue(request.getHeader(HEADER_NAME)); } - + // doPost removed for security reasons due to the possibility of sending // unsecure XML and XSL XSLTInputSources through the request input stream @@ -204,26 +204,30 @@ public String getMedia(HttpServletRequest request) */ public void doGet (HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException + throws ServletException, IOException { try - { + { TransformerFactory tFactory = TransformerFactory.newInstance(); process(tFactory, request, response); } catch (Exception e) { + // discard } } - + /** - * Coordinates applying an XSL stylesheet to XML data using operational parameters. - *

    If successfully applied, the result tree will be streamed to the response object - * and the content type set according to the XSL stylesheet's <xsl:output> element(s).

    - *

    If there is a problem in parsing the XML/XSL or if there is a problem in applying - * the XSL to the XML, an exception will be streamed to the response object. The detail - * of the information returned in the response object will depend on whether we're - * running in debug mode or not.

    + * Coordinates applying an XSL stylesheet to XML data using + * operational parameters.

    If successfully applied, the result + * tree will be streamed to the response object and the content type + * set according to the XSL stylesheet's <xsl:output> + * element(s).

    If there is a problem in parsing the XML/XSL + * or if there is a problem in applying the XSL to the XML, an + * exception will be streamed to the response object. The detail of + * the information returned in the response object will depend on + * whether we're running in debug mode or not.

    + * @param processor implementation of TRaX processor * @param request May contain information relevant to creating XML and XSL XSLTInputSource's * @param response Where to write the transformation result @@ -235,11 +239,11 @@ public void doGet (HttpServletRequest request, * @exception ServletException Never thrown * @exception IOException Never thrown */ - - public void process(TransformerFactory tFactory, - HttpServletRequest request, + + public void process(TransformerFactory tFactory, + HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException, SAXException + throws ServletException, IOException, SAXException { boolean debug = ourDefaultParameters.isDebug(request); @@ -249,10 +253,10 @@ public void process(TransformerFactory tFactory, // Listener to be used for all reporting ApplyXSLTListener listener = new ApplyXSLTListener(); - listener.out.println("debug is " + debug); + listener.out.println("debug is " + debug); StreamSource xmlSource = null; - StreamSource xslSource = null; + StreamSource xslSource = null; try { if ((xmlSource = getDocument(request, listener)) == null) @@ -262,7 +266,9 @@ public void process(TransformerFactory tFactory, } catch (ApplyXSLTException axe) { - axe.appendMessage(EOL + "getDocument() resulted in ApplyXSLTException" + EOL + axe.appendMessage(EOL + + "getDocument() resulted in ApplyXSLTException" + + EOL + listener.getMessage()); if (debug) writeLog(axe); displayException(response, axe, debug); @@ -270,93 +276,95 @@ public void process(TransformerFactory tFactory, } // creating XSL Stylesheet if (xmlSource != null) - { + { try { - if ((xslSource = getStylesheet(tFactory, request, xmlSource, listener)) == null) - { + if ((xslSource = getStylesheet(tFactory, request, xmlSource, listener)) == null) + { throw new ApplyXSLTException("getStylesheet() returned null", new NullPointerException(), response.SC_NOT_FOUND); } // For time being, must "reset" xmlSource after extracting stylesheet PI - xmlSource = getDocument(request, listener); + xmlSource = getDocument(request, listener); } catch (ApplyXSLTException axe) { - axe.appendMessage(EOL + "getStylesheet() resulted in ApplyXSLTException" + EOL + axe.appendMessage(EOL + + "getStylesheet() resulted in ApplyXSLTException" + + EOL + listener.getMessage()); if (debug) writeLog(axe); displayException(response, axe, debug); xslSource = null; } - // perform Transformation - - if ((xmlSource != null) && (xslSource != null)) - { - try - { - listener.out.println("Performing transformation..."); - - Templates templates = tFactory.newTemplates(xslSource); - Transformer transformer = templates.newTransformer(); + // perform Transformation + + if ((xmlSource != null) && (xslSource != null)) + { + try { - try + listener.out.println("Performing transformation..."); + + Templates templates = tFactory.newTemplates(xslSource); + Transformer transformer = templates.newTransformer(); { - String contentType = null; - contentType = getContentType(templates); - if (contentType != null); + try + { + String contentType = null; + contentType = getContentType(templates); + if (contentType != null); response.setContentType(contentType); - if (transformer instanceof TransformerImpl) - { - TransformerImpl transformerImpl = (TransformerImpl)transformer; - transformerImpl.setQuietConflictWarnings(ourDefaultParameters.isNoCW(request)); - } - - setStylesheetParams(transformer, request); - transformer.transform(xmlSource, new StreamResult(response.getOutputStream())); - - if (debug) - writeLog(listener.getMessage(), response.SC_OK); + if (transformer instanceof TransformerImpl) + { + TransformerImpl transformerImpl = (TransformerImpl)transformer; + transformerImpl.setQuietConflictWarnings(ourDefaultParameters.isNoCW(request)); + } + + setStylesheetParams(transformer, request); + transformer.transform(xmlSource, new StreamResult(response.getOutputStream())); + + if (debug) + writeLog(listener.getMessage(), response.SC_OK); + } + catch (Exception exc) + { + ApplyXSLTException axe = + new ApplyXSLTException("Exception occurred during Transformation:" + + EOL + listener.getMessage() + EOL + + exc.getMessage(), + exc, + response.SC_INTERNAL_SERVER_ERROR); + if (debug) writeLog(axe); + displayException(response, axe, debug); + } + finally + { + // transformer.reset(); + } // end of try ... catch ... finally } - catch (Exception exc) - { - ApplyXSLTException axe = new ApplyXSLTException - ("Exception occurred during Transformation:" - + EOL + listener.getMessage() + EOL - + exc.getMessage(), - exc, - response.SC_INTERNAL_SERVER_ERROR); + } + catch (/*org.xml.sax.SAX*/Exception saxExc) + { + ApplyXSLTException axe = new ApplyXSLTException( + "Exception occurred during ctor/Transformation:" + + EOL + listener.getMessage() + EOL + + saxExc.getMessage(), + saxExc, + response.SC_INTERNAL_SERVER_ERROR); if (debug) writeLog(axe); displayException(response, axe, debug); - } - finally - { - // transformer.reset(); - } // end of try ... catch ... finally - } - } - catch (/*org.xml.sax.SAX*/Exception saxExc) + } // end of new try ... catch + } // end of if((stylesheetRoot != null) ... + if (debug) { - ApplyXSLTException axe = new ApplyXSLTException - ("Exception occurred during ctor/Transformation:" - + EOL + listener.getMessage() + EOL - + saxExc.getMessage(), - saxExc, - response.SC_INTERNAL_SERVER_ERROR); - if (debug) writeLog(axe); - displayException(response, axe, debug); - } // end of new try ... catch - } // end of if((stylesheetRoot != null) ... - if (debug) - { - time = System.currentTimeMillis() - time; - writeLog(" No Conflict Warnings = " + ourDefaultParameters.isNoCW(request) + - " Transformation time: " + time + " ms", response.SC_OK); + time = System.currentTimeMillis() - time; + writeLog(" No Conflict Warnings = " + ourDefaultParameters.isNoCW(request) + + " Transformation time: " + time + " ms", response.SC_OK); + } } } - } /** * Returns an XML XSLTInputSource DOM. Attempts will be make to create the DOM from the following @@ -385,10 +393,10 @@ protected StreamSource getDocument(HttpServletRequest request, if ((xmlURL = request.getPathInfo()) != null) { listener.out.println("Parsing XML Document from PathInfo: " + xmlURL); - return new StreamSource(new URL("http", ((DefaultApplyXSLTProperties) - ourDefaultParameters).getLocalHost(), + return new StreamSource(new URL("http", + ((DefaultApplyXSLTProperties) ourDefaultParameters).getLocalHost(), request.getServerPort(), - xmlURL.replace('\\', '/')).openStream()); + xmlURL.replace('\\', '/')).openStream()); } // document from Request parameter if ((xmlURL = ourDefaultParameters.getXMLurl(request)) != null) @@ -416,7 +424,7 @@ protected StreamSource getDocument(HttpServletRequest request, } /** - * Returns a Templates (StylesheetRoot) object. Attempts will be make to create the Stylesheet + * Returns a Templates (StylesheetRoot) object. Attempts will be make to create the Stylesheet * from the followingsources: *
      *
    1. A URL specified in the HTTP request's xslURL= parameter. This capability @@ -441,7 +449,7 @@ protected StreamSource getDocument(HttpServletRequest request, * @exception ApplyXSLTException Thrown if exception occurs while handling request */ protected StreamSource getStylesheet(TransformerFactory tFactory, - HttpServletRequest request, + HttpServletRequest request, StreamSource xmlSource, ApplyXSLTListener listener) throws ApplyXSLTException @@ -490,26 +498,26 @@ protected StreamSource getStylesheet(TransformerFactory tFactory, public String getContentType(Templates templates) { Properties oprops = templates.getOutputProperties(); - String encoding = oprops.getProperty(OutputKeys.ENCODING); - String media = oprops.getProperty(OutputKeys.MEDIA_TYPE); - if (media != null) - { + String encoding = oprops.getProperty(OutputKeys.ENCODING); + String media = oprops.getProperty(OutputKeys.MEDIA_TYPE); + if (media != null) + { if (encoding != null) return media + "; charset=" + encoding; return media; - } - else - { - String method = oprops.getProperty(OutputKeys.METHOD); - if (method.equals("html")) - return "text/html"; - else if (method.equals("text")) - return "text/plain"; - else - return "text/xml"; - } - } - + } + else + { + String method = oprops.getProperty(OutputKeys.METHOD); + if (method.equals("html")) + return "text/html"; + else if (method.equals("text")) + return "text/plain"; + else + return "text/xml"; + } + } + /** * Defines and sets select top-level XSL stylesheet variables from the HTTP request, which @@ -545,8 +553,8 @@ public void setStylesheetParams(Transformer transformer, HttpServletRequest requ { String[] paramVals = request.getParameterValues(paramName); if (paramVals != null) - transformer.setParameter(paramName, new XString(paramVals[0])); - + transformer.setParameter(paramName, new XString(paramVals[0])); + } catch (Exception e) { @@ -555,7 +563,7 @@ public void setStylesheetParams(Transformer transformer, HttpServletRequest requ try { transformer.setParameter("servlet-RemoteAddr", new XString(request.getRemoteAddr())); - + } catch (Exception e) { @@ -563,7 +571,7 @@ public void setStylesheetParams(Transformer transformer, HttpServletRequest requ try { transformer.setParameter("servlet-RemoteHost", new XString(request.getRemoteHost())); - + } catch (Exception e) { @@ -571,7 +579,7 @@ public void setStylesheetParams(Transformer transformer, HttpServletRequest requ try { transformer.setParameter("servlet-RemoteUser", new XString(request.getRemoteUser())); - + } catch (Exception e) { @@ -720,7 +728,7 @@ public static String getXSLURLfromDoc(StreamSource xmlSource, String tempURL = null, returnURL = null; try { - DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance(); + DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = dfactory.newDocumentBuilder(); Node sourceTree = docBuilder.parse(xmlSource.getInputStream()); for(Node child=sourceTree.getFirstChild(); null != child; child=child.getNextSibling()) @@ -748,7 +756,7 @@ public static String getXSLURLfromDoc(StreamSource xmlSource, { } return returnURL; - } + } /** * The attribute name in the tag used in stylesheet selection. @@ -756,7 +764,7 @@ public static String getXSLURLfromDoc(StreamSource xmlSource, protected static final String STYLESHEET_ATTRIBUTE = "media"; /** - * The HTTP Header used for matching the Stylesheet attribute via the + * The HTTP Header used for matching the Stylesheet attribute via the * media properties file selected. */ protected static final String HEADER_NAME = "user-Agent"; @@ -825,7 +833,6 @@ String getValue(String s) */ class PIA { - private Hashtable piAttributes = null; /** @@ -850,5 +857,5 @@ class PIA String getAttribute(String name) { return (String) piAttributes.get(name); - } + } } diff --git a/samples/servlet/ApplyXSLTException.java b/xalanservlet/src/main/java/servlet/ApplyXSLTException.java similarity index 100% rename from samples/servlet/ApplyXSLTException.java rename to xalanservlet/src/main/java/servlet/ApplyXSLTException.java diff --git a/samples/servlet/ApplyXSLTListener.java b/xalanservlet/src/main/java/servlet/ApplyXSLTListener.java similarity index 98% rename from samples/servlet/ApplyXSLTListener.java rename to xalanservlet/src/main/java/servlet/ApplyXSLTListener.java index 7e0f95bd3..0fab4b914 100644 --- a/samples/servlet/ApplyXSLTListener.java +++ b/xalanservlet/src/main/java/servlet/ApplyXSLTListener.java @@ -23,6 +23,7 @@ import java.io.*; import org.xml.sax.*; import org.apache.xml.utils.DefaultErrorHandler; +import org.xml.sax.SAXException; /***************************************************************************************************** * ApplyXSLTListener provides a buffered listener essential for capturing, and then subsequently diff --git a/samples/servlet/ApplyXSLTProperties.java b/xalanservlet/src/main/java/servlet/ApplyXSLTProperties.java similarity index 100% rename from samples/servlet/ApplyXSLTProperties.java rename to xalanservlet/src/main/java/servlet/ApplyXSLTProperties.java diff --git a/samples/servlet/DefaultApplyXSLTProperties.java b/xalanservlet/src/main/java/servlet/DefaultApplyXSLTProperties.java similarity index 100% rename from samples/servlet/DefaultApplyXSLTProperties.java rename to xalanservlet/src/main/java/servlet/DefaultApplyXSLTProperties.java diff --git a/samples/servlet/SimpleXSLTServlet.java b/xalanservlet/src/main/java/servlet/SimpleXSLTServlet.java similarity index 100% rename from samples/servlet/SimpleXSLTServlet.java rename to xalanservlet/src/main/java/servlet/SimpleXSLTServlet.java diff --git a/samples/servlet/UseStylesheetParamServlet.java b/xalanservlet/src/main/java/servlet/UseStylesheetParamServlet.java similarity index 100% rename from samples/servlet/UseStylesheetParamServlet.java rename to xalanservlet/src/main/java/servlet/UseStylesheetParamServlet.java diff --git a/samples/servlet/XSLTServletWithParams.java b/xalanservlet/src/main/java/servlet/XSLTServletWithParams.java similarity index 99% rename from samples/servlet/XSLTServletWithParams.java rename to xalanservlet/src/main/java/servlet/XSLTServletWithParams.java index eb60e47d6..e59df6c61 100644 --- a/samples/servlet/XSLTServletWithParams.java +++ b/xalanservlet/src/main/java/servlet/XSLTServletWithParams.java @@ -19,6 +19,7 @@ * $Id$ */ package servlet; + import javax.servlet.*; import javax.servlet.http.*; import java.io.*; diff --git a/samples/servlet/web.xml b/xalanservlet/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from samples/servlet/web.xml rename to xalanservlet/src/main/webapp/WEB-INF/web.xml diff --git a/samples/servlet/birds.xml b/xalanservlet/src/main/webapp/birds.xml similarity index 100% rename from samples/servlet/birds.xml rename to xalanservlet/src/main/webapp/birds.xml diff --git a/samples/servlet/birds.xsl b/xalanservlet/src/main/webapp/birds.xsl similarity index 100% rename from samples/servlet/birds.xsl rename to xalanservlet/src/main/webapp/birds.xsl diff --git a/samples/servlet/booklist1.xsl b/xalanservlet/src/main/webapp/booklist1.xsl similarity index 100% rename from samples/servlet/booklist1.xsl rename to xalanservlet/src/main/webapp/booklist1.xsl diff --git a/samples/servlet/booklist2.xsl b/xalanservlet/src/main/webapp/booklist2.xsl similarity index 100% rename from samples/servlet/booklist2.xsl rename to xalanservlet/src/main/webapp/booklist2.xsl diff --git a/samples/servlet/catalog.xml b/xalanservlet/src/main/webapp/catalog.xml similarity index 100% rename from samples/servlet/catalog.xml rename to xalanservlet/src/main/webapp/catalog.xml diff --git a/samples/servlet/default.xsl b/xalanservlet/src/main/webapp/default.xsl similarity index 99% rename from samples/servlet/default.xsl rename to xalanservlet/src/main/webapp/default.xsl index d8c5b1dad..9a45c4b96 100644 --- a/samples/servlet/default.xsl +++ b/xalanservlet/src/main/webapp/default.xsl @@ -291,4 +291,4 @@ - \ No newline at end of file + diff --git a/samples/servlet/default2.xsl b/xalanservlet/src/main/webapp/default2.xsl similarity index 100% rename from samples/servlet/default2.xsl rename to xalanservlet/src/main/webapp/default2.xsl diff --git a/samples/servlet/fooparam.xml b/xalanservlet/src/main/webapp/fooparam.xml similarity index 100% rename from samples/servlet/fooparam.xml rename to xalanservlet/src/main/webapp/fooparam.xml diff --git a/samples/servlet/fooparam.xsl b/xalanservlet/src/main/webapp/fooparam.xsl similarity index 100% rename from samples/servlet/fooparam.xsl rename to xalanservlet/src/main/webapp/fooparam.xsl diff --git a/samples/servlet/jspSample.jsp b/xalanservlet/src/main/webapp/jspSample.jsp similarity index 100% rename from samples/servlet/jspSample.jsp rename to xalanservlet/src/main/webapp/jspSample.jsp diff --git a/xalanservlet/src/site/xhtml/servlet/readme.xhtml b/xalanservlet/src/site/xhtml/servlet/readme.xhtml new file mode 100644 index 000000000..415137e63 --- /dev/null +++ b/xalanservlet/src/site/xhtml/servlet/readme.xhtml @@ -0,0 +1,30 @@ + + + + + + Xalan Samples + + +

      Xalan Samples

      +

      For information about the samples (what they illustrate and how to run them), see Samples.

      + + + + diff --git a/xdocs/xml-site-style.tar.gz b/xdocs/xml-site-style.tar.gz deleted file mode 100644 index bc1abffaf..000000000 Binary files a/xdocs/xml-site-style.tar.gz and /dev/null differ diff --git a/xsltcapplet/pom.xml b/xsltcapplet/pom.xml new file mode 100644 index 000000000..529c0bccb --- /dev/null +++ b/xsltcapplet/pom.xml @@ -0,0 +1,129 @@ + + + 4.0.0 + + xalan-j + xalan + 2.7.3 + + + xsltcapplet + Apache Xalan-Java Applet Sample + + http://www.example.com + + + UTF-8 + 1.8 + 1.8 + + + + + xalan + serializer + + + xalan + xalan + + + + xalan + ${xalan.taglet.artifactId} + provided + + + + + javax.servlet + servlet-api + 2.5 + provided + + + + + javax.ejb + ejb-api + 3.0 + provided + + + + + xerces + xercesImpl + 2.12.2 + provided + + + + + dev.aspectj + sunlabs.brazil + 2.3.1 + + + + + org.jboss.spec.javax.rmi + jboss-rmi-api_1.0_spec + 1.0.6.Final + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + + + + + create-javadocs + + + [1,) + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + + create-sources + + + [1,) + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + + + diff --git a/samples/CompiledApplet/README.applet b/xsltcapplet/src/main/java/samples/CompiledApplet/README.applet similarity index 100% rename from samples/CompiledApplet/README.applet rename to xsltcapplet/src/main/java/samples/CompiledApplet/README.applet diff --git a/samples/CompiledApplet/TransformApplet.java b/xsltcapplet/src/main/java/samples/CompiledApplet/TransformApplet.java similarity index 99% rename from samples/CompiledApplet/TransformApplet.java rename to xsltcapplet/src/main/java/samples/CompiledApplet/TransformApplet.java index 52baa1b12..8d2e34ffe 100644 --- a/samples/CompiledApplet/TransformApplet.java +++ b/xsltcapplet/src/main/java/samples/CompiledApplet/TransformApplet.java @@ -18,6 +18,7 @@ /* * $Id$ */ +package samples.CompiledApplet; import java.applet.Applet; diff --git a/samples/CompiledApplet/index.html b/xsltcapplet/src/main/java/samples/CompiledApplet/index.html similarity index 100% rename from samples/CompiledApplet/index.html rename to xsltcapplet/src/main/java/samples/CompiledApplet/index.html diff --git a/samples/CompiledApplet/menu.html b/xsltcapplet/src/main/java/samples/CompiledApplet/menu.html similarity index 100% rename from samples/CompiledApplet/menu.html rename to xsltcapplet/src/main/java/samples/CompiledApplet/menu.html diff --git a/samples/CompiledApplet/singleTransform.html b/xsltcapplet/src/main/java/samples/CompiledApplet/singleTransform.html similarity index 100% rename from samples/CompiledApplet/singleTransform.html rename to xsltcapplet/src/main/java/samples/CompiledApplet/singleTransform.html diff --git a/xsltcapplet/src/site/xhtml/CompiledApplet/index.xhtml b/xsltcapplet/src/site/xhtml/CompiledApplet/index.xhtml new file mode 100644 index 000000000..a55208f03 --- /dev/null +++ b/xsltcapplet/src/site/xhtml/CompiledApplet/index.xhtml @@ -0,0 +1,28 @@ + + +XSLT Applet Demonstration + + + + + + + + + diff --git a/xsltcapplet/src/site/xhtml/CompiledApplet/menu.xhtml b/xsltcapplet/src/site/xhtml/CompiledApplet/menu.xhtml new file mode 100644 index 000000000..59b9f5de6 --- /dev/null +++ b/xsltcapplet/src/site/xhtml/CompiledApplet/menu.xhtml @@ -0,0 +1,68 @@ + + + + +
      + +

      Xalan/XSLTC Applet Demo

      +

      +Each of these examples illustrate the use of translets +within a Java applet: +

      + + + +
      +

      Select translet:

      +

      +

      Select XML source document:

      +

      +

      +
      + + + + + + diff --git a/xsltcapplet/src/site/xhtml/CompiledApplet/singleTransform.xhtml b/xsltcapplet/src/site/xhtml/CompiledApplet/singleTransform.xhtml new file mode 100644 index 000000000..4ce8824d2 --- /dev/null +++ b/xsltcapplet/src/site/xhtml/CompiledApplet/singleTransform.xhtml @@ -0,0 +1,26 @@ + + + + + + + + + + diff --git a/xsltcbrazil/pom.xml b/xsltcbrazil/pom.xml new file mode 100644 index 000000000..33d6b7780 --- /dev/null +++ b/xsltcbrazil/pom.xml @@ -0,0 +1,129 @@ + + + 4.0.0 + + xalan-j + xalan + 2.7.3 + + + xsltcbrazil + Apache Xalan-Java Brazil Sample + + http://www.example.com + + + UTF-8 + 1.8 + 1.8 + + + + + xalan + serializer + + + xalan + xalan + + + + xalan + ${xalan.taglet.artifactId} + provided + + + + + javax.servlet + servlet-api + 2.5 + provided + + + + + javax.ejb + ejb-api + 3.0 + provided + + + + + xerces + xercesImpl + 2.12.2 + provided + + + + + dev.aspectj + sunlabs.brazil + 2.3.1 + + + + + org.jboss.spec.javax.rmi + jboss-rmi-api_1.0_spec + 1.0.6.Final + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + + + + + create-javadocs + + + [1,) + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + + create-sources + + + [1,) + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + + + diff --git a/xsltcbrazil/src/main/java/samples/CompiledBrazil/README.brazil b/xsltcbrazil/src/main/java/samples/CompiledBrazil/README.brazil new file mode 100644 index 000000000..0dcab658d --- /dev/null +++ b/xsltcbrazil/src/main/java/samples/CompiledBrazil/README.brazil @@ -0,0 +1,108 @@ +============================================================ + +CONTENTS OF THIS DOCUMENT: + + o) HOW TO PROVIDE XSL TRANSFORMATIONS AS A WEB SERVICE + o) HOW TO INVOKE TRANSLETS FROM A BRAZIL HANDLER + +------------------------------------------------------------ + +HOW TO PROVIDE XSL TRANSFORMATIONS AS A WEB SERVICE + +This sample code illustrates how Xalan/XSLTC can be used to +offer XSL transformations as a web service without using a +full web server. We have chosen to use the Brazil prototype +for the web interface, originally available from Sunlabs: + + http://www.sun.com/research/brazil/ + +Both the website and the original downloads no longer exist. +An archived copy of the website (without downloads) is +available at: + + https://web.archive.org/web/20090402221714/http://research.sun.com/brazil/ + +The original code, slightly improved to be compilable on +JDK 17 ('yield' keyword), is available at: + + https://github.com/dev-aspectj/brazil + +Maven Central coordinates: + + dev.aspectj:sunlabs.brazil:2.3.1 + +We could easily have used some other web interface such +as Tomcat. The supplied Java code implements a Brazil +"handler", which very much resembles a servlet. + +The CompiledEJB and CompiledServlet sample code +demonstrate other approaches to providing XSL transformations +as a web service. + +------------------------------------------------------------ + +HOW TO INVOKE TRANSLETS FROM A BRAZIL HANDLER + +The CompiledBrazil directory contains the example source code: + + TransformHandler.java + +This file contains a minimal implementation of an XSL +transformation handler, to be used with Brazil. + +Compile any stylesheets you're interested in into translets. +Set your CLASSPATH to include xalan.jar, xercesImpl.jar, +xml-apis.jar, your translet classes and the Brazil server +jar file. + +You can now set up the Brazil server to service requests by +using the following command: + +java -cp \ + -Djavax.xml.transform.TransformerFactory=org.apache.xalan.xsltc.trax.TransformerFactoryImpl \ + sunlabs.brazil.server.Main -port 8080 \ + -handler samples.CompiledBrazil.TransformHandler + +In a browser, you can enter a URI similar to the following: + + http://localhost:8080/?translet=myTrans&document=myDoc + +where "myTrans" is the URI of a stylesheet that you've +compiled into a translet and "myDoc" is URI of an XML document +you'd like to process using that stylesheet. The result of +the transformation will be displayed in your browser. + +You can test this in the Xalan-Java source code repository +like this (Git Bash on Windows, please adjust shell syntax +Brazil classpath to your needs): + +Console A: + +mvn clean compile +mvn -pl xalan exec:java \ + -Dexec.mainClass=org.apache.xalan.xsltc.cmdline.Compile \ + -Dexec.arguments=samples/src/main/java/samples/SimpleTransform/birds.xsl +java \ + -cp "C:/Users/USER_ID/.m2/repository/dev/aspectj/sunlabs.brazil/2.3.1/sunlabs.brazil-2.3.1.jar;.;xalan/target/classes;serializer/target/classes;samples/target/classes" \ + -Djavax.xml.transform.TransformerFactory=org.apache.xalan.xsltc.trax.TransformerFactoryImpl \ + sunlabs.brazil.server.Main -port 8080 \ + -handler samples.CompiledBrazil.TransformHandler + +Console B (with server running on console A): + +curl "http://localhost:8080/?translet=birds&document=samples/src/main/java/samples/SimpleTransform/birds.xml" + +Console output should be similar to: + + +Order is: TINAMIFORMES + Family is: TINAMIDAE + Great Tinamou. Tinamus major + Highland Tinamou. Nothocercus +(...) + Family is: FREGATIDAE + Magnificent Frigatebird. Fregata magnificens + Great Frigatebird. Fregata minor + Lesser Frigatebird. (A) Fregata ariel + + diff --git a/samples/CompiledBrazil/TransformHandler.java b/xsltcbrazil/src/main/java/samples/CompiledBrazil/TransformHandler.java similarity index 99% rename from samples/CompiledBrazil/TransformHandler.java rename to xsltcbrazil/src/main/java/samples/CompiledBrazil/TransformHandler.java index 530f6bceb..f594455d1 100644 --- a/samples/CompiledBrazil/TransformHandler.java +++ b/xsltcbrazil/src/main/java/samples/CompiledBrazil/TransformHandler.java @@ -18,6 +18,7 @@ /* * $Id$ */ +package samples.CompiledBrazil; import java.io.IOException; import java.io.PrintWriter; diff --git a/xsltcejb/pom.xml b/xsltcejb/pom.xml new file mode 100644 index 000000000..7744ff4f0 --- /dev/null +++ b/xsltcejb/pom.xml @@ -0,0 +1,129 @@ + + + 4.0.0 + + xalan-j + xalan + 2.7.3 + + + xsltcejb + Apache Xalan-Java XSLTC EJB sample + + http://www.example.com + + + UTF-8 + 1.8 + 1.8 + + + + + xalan + serializer + + + xalan + xalan + + + + xalan + ${xalan.taglet.artifactId} + provided + + + + + javax.servlet + servlet-api + 2.5 + provided + + + + + javax.ejb + ejb-api + 3.0 + provided + + + + + xerces + xercesImpl + 2.12.2 + provided + + + + + dev.aspectj + sunlabs.brazil + 2.3.1 + + + + + org.jboss.spec.javax.rmi + jboss-rmi-api_1.0_spec + 1.0.6.Final + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + + + + + create-javadocs + + + [1,) + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + + create-sources + + + [1,) + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + + + diff --git a/samples/CompiledEJB/README.ejb b/xsltcejb/src/main/java/samples/CompiledEJB/README.ejb similarity index 100% rename from samples/CompiledEJB/README.ejb rename to xsltcejb/src/main/java/samples/CompiledEJB/README.ejb diff --git a/samples/CompiledEJB/TransformBean.java b/xsltcejb/src/main/java/samples/CompiledEJB/TransformBean.java similarity index 99% rename from samples/CompiledEJB/TransformBean.java rename to xsltcejb/src/main/java/samples/CompiledEJB/TransformBean.java index 592fc99e7..8e33a94f4 100644 --- a/samples/CompiledEJB/TransformBean.java +++ b/xsltcejb/src/main/java/samples/CompiledEJB/TransformBean.java @@ -18,6 +18,7 @@ /* * $Id$ */ +package samples.CompiledEJB; import java.io.PrintWriter; import java.io.StringWriter; diff --git a/samples/CompiledEJB/TransformHome.java b/xsltcejb/src/main/java/samples/CompiledEJB/TransformHome.java similarity index 97% rename from samples/CompiledEJB/TransformHome.java rename to xsltcejb/src/main/java/samples/CompiledEJB/TransformHome.java index 9451c1c63..71ae04d1c 100644 --- a/samples/CompiledEJB/TransformHome.java +++ b/xsltcejb/src/main/java/samples/CompiledEJB/TransformHome.java @@ -18,6 +18,8 @@ /* * $Id$ */ +package samples.CompiledEJB; + import java.rmi.RemoteException; diff --git a/samples/CompiledEJB/TransformRemote.java b/xsltcejb/src/main/java/samples/CompiledEJB/TransformRemote.java similarity index 97% rename from samples/CompiledEJB/TransformRemote.java rename to xsltcejb/src/main/java/samples/CompiledEJB/TransformRemote.java index 14b29947f..8682c5913 100644 --- a/samples/CompiledEJB/TransformRemote.java +++ b/xsltcejb/src/main/java/samples/CompiledEJB/TransformRemote.java @@ -18,6 +18,8 @@ /* * $Id$ */ +package samples.CompiledEJB; + import java.rmi.RemoteException; diff --git a/samples/CompiledEJB/TransformServlet.java b/xsltcejb/src/main/java/samples/CompiledEJB/TransformServlet.java similarity index 98% rename from samples/CompiledEJB/TransformServlet.java rename to xsltcejb/src/main/java/samples/CompiledEJB/TransformServlet.java index 55391709f..619034975 100644 --- a/samples/CompiledEJB/TransformServlet.java +++ b/xsltcejb/src/main/java/samples/CompiledEJB/TransformServlet.java @@ -18,6 +18,8 @@ /* * $Id$ */ +package samples.CompiledEJB; + import java.io.IOException; import java.io.PrintWriter; diff --git a/samples/CompiledEJB/bottom_frame.html b/xsltcejb/src/main/java/samples/CompiledEJB/bottom_frame.html similarity index 100% rename from samples/CompiledEJB/bottom_frame.html rename to xsltcejb/src/main/java/samples/CompiledEJB/bottom_frame.html diff --git a/samples/CompiledEJB/index.html b/xsltcejb/src/main/java/samples/CompiledEJB/index.html similarity index 100% rename from samples/CompiledEJB/index.html rename to xsltcejb/src/main/java/samples/CompiledEJB/index.html diff --git a/samples/CompiledEJB/top_frame.html b/xsltcejb/src/main/java/samples/CompiledEJB/top_frame.html similarity index 100% rename from samples/CompiledEJB/top_frame.html rename to xsltcejb/src/main/java/samples/CompiledEJB/top_frame.html diff --git a/xsltcejb/src/site/xhtml/CompiledEJB/bottom_frame.xhtml b/xsltcejb/src/site/xhtml/CompiledEJB/bottom_frame.xhtml new file mode 100644 index 000000000..3fdbdf42f --- /dev/null +++ b/xsltcejb/src/site/xhtml/CompiledEJB/bottom_frame.xhtml @@ -0,0 +1,23 @@ + + + + + + + diff --git a/xsltcejb/src/site/xhtml/CompiledEJB/index.xhtml b/xsltcejb/src/site/xhtml/CompiledEJB/index.xhtml new file mode 100644 index 000000000..a8f2d8a77 --- /dev/null +++ b/xsltcejb/src/site/xhtml/CompiledEJB/index.xhtml @@ -0,0 +1,27 @@ + + + XML Technology Center + + + + + + +</html> + diff --git a/xsltcejb/src/site/xhtml/CompiledEJB/top_frame.xhtml b/xsltcejb/src/site/xhtml/CompiledEJB/top_frame.xhtml new file mode 100644 index 000000000..b83e7277c --- /dev/null +++ b/xsltcejb/src/site/xhtml/CompiledEJB/top_frame.xhtml @@ -0,0 +1,122 @@ +<!-- + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +--> +<html> + + <head> + <base target="xtc_menu"/> + </head> + + <body bgcolor="#ffffff"> + + <center><h1>Server-side XSL transformations</h1><p/></center> + + <script language="JavaScript"> + <![CDATA[ + function getURI() { + var root = "http://gobsheen.ireland/morten/Sun/XTC/demo/plays/"; + var menu = document.XMLinput.elements[0]; + var play = menu.options[menu.selectedIndex].value; + return(root+play); + } + + function getTranslet() { + var menu = document.XMLinput.elements[1]; + var translet = menu.options[menu.selectedIndex].value; + return(translet); + } + + function setHTMLlocation(translet) { + var uri = getURI(); + var translet = getTranslet(); + var source = "http://gobsheen:8000/Transform/Transform?"+ + "document="+uri+"&translet="+translet; + open(source,"bottom"); + } + + function setXMLlocation() { + var target = parent.frames.demo_bottom; + var uri = getURI(); + open(uri,"bottom"); + } + ]]> + </script> + + <form name="XMLinput"> + + <table> + <tr> + <td> + <b>Source document:</b> + </td> + <td> + <select name="dropdown"> + <option value="AsYouLikeIt.xml">As You Like It</option> + <option value="Cymbeline.xml">Cymbeline</option> + <option value="Hamlet.xml">The Tragedy of Hamlet</option> + <option value="HenryV.xml">The Life of Henry V</option> + <option value="HenryVIII.xml">The Famous History of the Life of Henry VIII</option> + <option value="KingJohn.xml">The Life and Death of King John</option> + <option value="KingLear.xml">The Tragedy of King Lear</option> + <option value="KingRichardII.xml">The Tragedy of King Richard II</option> + <option value="MeasureForMeasure.xml">Measure for Measure</option> + <option value="MerchantOfVenice.xml">The Merchant of Venice</option> + <option value="MerryWivesOfWindsor.xml">The Merry Wives of Windsor</option> + <option value="MidsummerNightsDream.xml">A Midsummer Night's Dream</option> + <option value="MuchAdoAboutNothing.xml">Much Ado about Nothing</option> + <option value="PericlesPrinceOfTyre.xml">Pericles, Prince of Tyre</option> + <option value="RomeoAndJuliet.xml">The Tragedy of Romeo and Juliet</option> + <option value="TamingOfTheShrew.xml">The Taming of the Shrew</option> + <option value="TheTempest.xml">The Tempest</option> + <option value="TimonOfAthens.xml">The Life of Timon of Athens</option> + <option value="TragedyOfCoriolanus.xml">The Tragedy of Coriolanus</option> + <option value="TragedyOfJuliusCaesar.xml">The Tragedy of Julius Caesar</option> + <option value="TragedyOfOthello.xml">The Tragedy of Othello, the Moor of Venice</option> + <option value="TroilusAndCresida.xml">The History of Troilus and Cressida</option> + <option value="TwelfthNight.xml">Twelfth Night, or What You Will</option> + <option value="TwoGentlementOfVerona.xml">The Two Gentlemen of Verona</option> + <option value="WintersTale.xml">The Winter's Tale</option> + </select> + </td> + </tr> + <tr> + <td> + <b>Transformation:</b> + </td> + <td> + <select name="dropdown"> + <option value="PlayToHTML">Full</option> + <option value="PlayToSpeakers">Speakers</option> + <option value="PlayToIndex">Index</option> + </select> + </td> + </tr> + <tr> + <td> + <b>Method:</b> + </td> + <td> + <input type="button" value="Transform" onClick="setHTMLlocation()"/> + <input type="button" value="XML source" onClick="setXMLlocation()"/> + </td> + </tr> + </table> + </form> + + </body> + +</html> diff --git a/xsltcservlet/pom.xml b/xsltcservlet/pom.xml new file mode 100644 index 000000000..37fea4e74 --- /dev/null +++ b/xsltcservlet/pom.xml @@ -0,0 +1,130 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- See also: xalansamples, xsltcapplet, xsltcbrazil, xsltcejb, xsltcservlet --> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <artifactId>xalan-j</artifactId> + <groupId>xalan</groupId> + <version>2.7.3</version> + </parent> + + <artifactId>xsltcservlet</artifactId> + <name>Apache Xalan-Java Compiled Servlet Sample</name> + <!-- FIXME change it to the project's website --> + <url>http://www.example.com</url> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <maven.compiler.source>1.8</maven.compiler.source> + <maven.compiler.target>1.8</maven.compiler.target> + </properties> + + <dependencies> + <dependency> + <groupId>xalan</groupId> + <artifactId>serializer</artifactId> + </dependency> + <dependency> + <groupId>xalan</groupId> + <artifactId>xalan</artifactId> + </dependency> + <!-- For javadoc generation only, hence 'provided' scope --> + <dependency> + <groupId>xalan</groupId> + <artifactId>${xalan.taglet.artifactId}</artifactId> + <scope>provided</scope> + </dependency> + + <!-- https://mvnrepository.com/artifact/javax.servlet/servlet-api --> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>2.5</version> <!-- jakata servlet is at 6.0 --> + <scope>provided</scope> + </dependency> + + <!-- https://mvnrepository.com/artifact/javax.ejb/ejb-api --> + <dependency> + <groupId>javax.ejb</groupId> + <artifactId>ejb-api</artifactId> + <version>3.0</version> + <scope>provided</scope> + </dependency> + + <!-- https://mvnrepository.com/artifact/xerces/xercesImpl --> + <dependency> + <groupId>xerces</groupId> + <artifactId>xercesImpl</artifactId> + <version>2.12.2</version> + <scope>provided</scope> + </dependency> + + <!-- https://github.com/dev-aspectj/brazil --> + <dependency> + <groupId>dev.aspectj</groupId> + <artifactId>sunlabs.brazil</artifactId> + <version>2.3.1</version> + </dependency> + + <!-- https://mvnrepository.com/artifact/org.jboss.spec.javax.rmi/jboss-rmi-api_1.0_spec --> + <dependency> + <groupId>org.jboss.spec.javax.rmi</groupId> + <artifactId>jboss-rmi-api_1.0_spec</artifactId> + <version>1.0.6.Final</version> + </dependency> + + </dependencies> + + <build> + <plugins> + <!-- Copy generated jarfile up to xalan-java/build/, + for backward compatibility with Ant builds. --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <id>create-javadocs</id> + <activation> + <!-- + Activate by default. Workaround for 'activeByDefault', which is broken + by design, see https://issues.apache.org/jira/browse/MNG-4917. + --> + <jdk>[1,)</jdk> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>create-sources</id> + <activation> + <!-- + Activate by default. Workaround for 'activeByDefault', which is broken + by design, see https://issues.apache.org/jira/browse/MNG-4917. + --> + <jdk>[1,)</jdk> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-source-plugin</artifactId> + </plugin> + </plugins> + </build> + </profile> + </profiles> + +</project> diff --git a/samples/CompiledServlet/CompileServlet.java b/xsltcservlet/src/main/java/samples/CompiledServlet/CompileServlet.java similarity index 98% rename from samples/CompiledServlet/CompileServlet.java rename to xsltcservlet/src/main/java/samples/CompiledServlet/CompileServlet.java index 0f2dca8c6..55b76b0ab 100644 --- a/samples/CompiledServlet/CompileServlet.java +++ b/xsltcservlet/src/main/java/samples/CompiledServlet/CompileServlet.java @@ -18,6 +18,8 @@ /* * $Id$ */ +package samples.CompiledServlet; + import java.io.IOException; import java.io.PrintWriter; diff --git a/samples/CompiledServlet/README.servlet b/xsltcservlet/src/main/java/samples/CompiledServlet/README.servlet similarity index 100% rename from samples/CompiledServlet/README.servlet rename to xsltcservlet/src/main/java/samples/CompiledServlet/README.servlet diff --git a/samples/CompiledServlet/TransformServlet.java b/xsltcservlet/src/main/java/samples/CompiledServlet/TransformationServlet.java similarity index 97% rename from samples/CompiledServlet/TransformServlet.java rename to xsltcservlet/src/main/java/samples/CompiledServlet/TransformationServlet.java index 67c13da13..e1e8ef280 100644 --- a/samples/CompiledServlet/TransformServlet.java +++ b/xsltcservlet/src/main/java/samples/CompiledServlet/TransformationServlet.java @@ -18,6 +18,7 @@ /* * $Id$ */ +package samples.CompiledServlet; import java.io.IOException; import java.io.PrintWriter; @@ -48,7 +49,7 @@ * @author Morten Jorgensen * @author Jacek Ambroziak */ -public final class TransformServlet extends HttpServlet { +public final class TransformationServlet extends HttpServlet { /** * Main servlet entry point