summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-02-01 14:17:09 +0900
committerRandy Morgan <[email protected]>2012-02-01 14:17:09 +0900
commitd4a00926a263329befc9526a930b274210a13abf (patch)
treea6de081124bf627716b30c098970fc8843e4606e /lib
parent38a3046b2a02b309ac5835c02c7a252ee4831d41 (diff)
downloadcaxlsx-d4a00926a263329befc9526a930b274210a13abf.tar.gz
caxlsx-d4a00926a263329befc9526a930b274210a13abf.zip
https://github.com/randym/axlsx/issues/21
fixed 'properly' but I've feeling the schema folder should actually be lib/axlsx/schema instead of lib/schema
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx/package.rb2
-rw-r--r--lib/axlsx/util/constants.rb15
2 files changed, 10 insertions, 7 deletions
diff --git a/lib/axlsx/package.rb b/lib/axlsx/package.rb
index a096bbc6..b725c0c7 100644
--- a/lib/axlsx/package.rb
+++ b/lib/axlsx/package.rb
@@ -157,7 +157,7 @@ module Axlsx
# @return [Array] An array of all validation errors encountered.
# @private
def validate_single_doc(schema, doc)
- schema = Nokogiri::XML::Schema(File.open(File.dirname(__FILE__)+schema))
+ schema = Nokogiri::XML::Schema(File.open(schema))
doc = Nokogiri::XML(doc)
errors = []
diff --git a/lib/axlsx/util/constants.rb b/lib/axlsx/util/constants.rb
index d7bb8524..5ca17a93 100644
--- a/lib/axlsx/util/constants.rb
+++ b/lib/axlsx/util/constants.rb
@@ -169,23 +169,26 @@ module Axlsx
# chart part
IMAGE_PN = "media/image%d.%s"
+ # location of schema files for validation
+ SCHEMA_BASE = File.dirname(__FILE__)+'/../../schema/'
+
# App validation schema
- APP_XSD = "/../schema/shared-documentPropertiesExtended.xsd"
+ APP_XSD = SCHEMA_BASE + "shared-documentPropertiesExtended.xsd"
# core validation schema
- CORE_XSD = "/../schema/opc-coreProperties.xsd"
+ CORE_XSD = SCHEMA_BASE + "opc-coreProperties.xsd"
# content types validation schema
- CONTENT_TYPES_XSD = "/../schema/opc-contentTypes.xsd"
+ CONTENT_TYPES_XSD = SCHEMA_BASE + "opc-contentTypes.xsd"
# rels validation schema
- RELS_XSD = "/../schema/opc-relationships.xsd"
+ RELS_XSD = SCHEMA_BASE + "opc-relationships.xsd"
# spreadsheetML validation schema
- SML_XSD = "/../schema/sml.xsd"
+ SML_XSD = SCHEMA_BASE + "sml.xsd"
# drawing validation schema
- DRAWING_XSD = "/../schema/dml-spreadsheetDrawing.xsd"
+ DRAWING_XSD = SCHEMA_BASE + "dml-spreadsheetDrawing.xsd"
# number format id for pecentage formatting using the default formatting id.
NUM_FMT_PERCENT = 9