Giter Club home page Giter Club logo

Comments (4)

SemyenSoldatenko avatar SemyenSoldatenko commented on September 11, 2024

My mistake.
I should be used this:
schemaUri = 'https://docs.oasis-open.org/ubl/cs-UBL-2.0/xsd/maindoc/UBL-Invoice-2.0.xsd'
it works.

p.s.offlineSchema setting works only with -PofflineSchemas=true

from foprenderer.

ramonwirsch avatar ramonwirsch commented on September 11, 2024

Hi,
so I just looked into it and this error occurs because internally URL is used everywhere and the setter setSchemaUri(String) just uses URL(string). The Java SAX stuff that is utilized internally only supports URL instances, because it attempts to actually load it.

If you can point me to an example how URNs can be used with SAX, I'll try to incorporate it into the plugin, but as of now it is not supported.

-- so I guess it doesn't matter now

from foprenderer.

ramonwirsch avatar ramonwirsch commented on September 11, 2024

The code I wrote for 'offline' should also check gradles --offline flag, but it has no builtin timeout.

Did the --offline flag actually not work for you? Then please provide me your gradle version, and I'll try to investigate further...

from foprenderer.

SemyenSoldatenko avatar SemyenSoldatenko commented on September 11, 2024

I was mislead by names schemaUri and offileSchema. I thought it is target namespace and xsd location.
But actually it is two different settings, one to work online and another one to work offline.

Now I've provided online url to fetch xsd, and local xsd files to use in offline mode, and it works:

schemas {
    InvoiceUBL20 {
        files = fileTree(dir: 'xml/invoices', include: '*.xml')
        schemaUri = 'https://docs.oasis-open.org/ubl/cs-UBL-2.0/xsd/maindoc/UBL-Invoice-2.0.xsd'
        offlineSchema = file('schemas/maindoc/UBL-Invoice-2.0.xsd')
    }
...

✅ It works:

Validate against online xsd files.
./gradlew validate

Validate against local xsd files.
./gradlew validate --offline
./gradlew validate -PofflineSchemas=true

My gradle version

$ ./gradlew -v

------------------------------------------------------------
Gradle 3.0
------------------------------------------------------------

Build time:   2016-08-15 13:15:01 UTC
Revision:     ad76ba00f59ecb287bd3c037bd25fc3df13ca558

Groovy:       2.4.7
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0_101 (Oracle Corporation 25.101-b13)
OS:           Mac OS X 10.12.5 x86_64

Thank you for your work.

from foprenderer.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.