Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XliffDumper output does not validate against xliff XSD #222

Open
webberig opened this issue Dec 17, 2014 · 6 comments
Open

XliffDumper output does not validate against xliff XSD #222

webberig opened this issue Dec 17, 2014 · 6 comments

Comments

@webberig
Copy link

Hi,

I used this bundle to extract translations and write them to an xliff file. When I validate the file against the Xliff 1.2 XSD schema, I get a lot of errors:

[ERROR 1871] Element '{urn:jms:translation}reference-file': This element is
   not expected. Expected is ( {urn:oasis:names:tc:xliff:document:1.2}source
  ). (in file:///D:/projects/i18n/ - line 984, column 0)

This is the XSD I'm using for validation:
http://docs.oasis-open.org/xliff/v1.2/cs02/xliff-core-1.2-strict.xsd

This problem also occurs when I'm using the Symfony XliffLoader, it throws the same errors because it seems to validate against the XSD as well...

@Nyholm
Copy link
Collaborator

Nyholm commented Mar 24, 2016

Thank you for reporting this. This issue is very old, do you have the same problem with the latest release?

@wimvds
Copy link

wimvds commented Mar 30, 2016

I just upgraded a project from Symfony 2.7 (via 2.8) to Symfony 3.0 and got the same error when upgrading and manually executing bin/console cache:clear. I have jms/translation-bundle 1.2.1 installed (on PHP 5.6.18) ...

IIRC I also had this issue before (in Symfony 2.7, prod environment), but then it was due to the fact that I had "jms/translation-bundle" as a dev requirement. Now it's in require, but still no luck. I can regenerate the XLIFFs using the JMS CLI commands without any error, but they can't be used by Symfony apparently. Reverted back to Symfony 2.8 hoping that that one still works. If I can find the time I'll try to look into it.

@Nyholm
Copy link
Collaborator

Nyholm commented Mar 30, 2016

Try with dev-master instead of 1.2.1. Also be aware of #332

@benjamin-hubert
Copy link
Collaborator

Also having errors with the dev-master.

[Symfony\Component\Translation\Exception\InvalidResourceException]
  Invalid resource provided: "1.2"; Errors: [ERROR 1845] Element '{urn:jms:translation}reference-file': No matching global element
   declaration available, but demanded by the strict wildcard. (in /var/www/ - line 18, column 0)
  [ERROR 1845] Element '{urn:jms:translation}reference-file': No matching global element declaration available, but demanded by th
  e strict wildcard. (in /var/www/ - line 23, column 0)
  [ERROR 1845] Element '{urn:jms:translation}reference-file': No matching global element declaration available, but demanded by th
  e strict wildcard. (in /var/www/ - line 24, column 0)
  [ERROR 1845] Element '{urn:jms:translation}reference-file': No matching global element declaration available, but demanded by th
  e strict wildcard. (in /var/www/ - line 25, column 0)

@hvt
Copy link

hvt commented Dec 1, 2016

I'm also suffering from this exact same error when upgrading from Symfony 2.3 to 2.8.

To be honest, I do not really know where this comes from exactly. Anybody got some pointers?

@hvt
Copy link

hvt commented Dec 1, 2016

Mmm, found it. I have three different kernels, sharing one same bundle. This bundle has JMSTranslationBundle generated XLIFF files. But only one of my kernels loaded the JMSTranslationBundle.

In these other two kernels, the default Symfony2 XLIFF loader complains (as @webberig mentioned) because there are XSD validation errors. That is because the urn:jms:translation namespace is not default.

I fixed it by also loading the JMSTranslationBundle for these other two kernels, so that JMSTranslationBundle's XLIFF loader was also used in these kernels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants