Comments (10)
Hi, this is not possible at the moment. I have solved it adding the prefix
in the root name.
But it will be an interesting feature for the jms serializer, PR are
welcome
On 12 Nov 2016 1:57 pm, "Frederico Martini" [email protected]
wrote:
While generating metadata files is possible to set namespace prefix to the
root element?
e.g:
myXmlElement:
xml_root_name: "ds1:foobar"
xml_root_namespace: "http://www.example"will turn serialized:
<ds1:foobar xmlns:ds1="http://www.example">
/ds1:foobar—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#5, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AAvaJ3SyrZ2H_SdfWWFb8hu0nTklxNCrks5q9beggaJpZM4KwaVM
.
from xsd2php.
Reading better your message, do not understand the problem. What you have suggested in your code snippet is exactly how is implemented now
from xsd2php.
I can only set prefix name to xml_root_name
in .yml files already generated, not based on config.yml
e.g.
I have the xsd above:
https://gist.github.com/fredericomartini/481a4fd7774cde6e93b85cdb042604c8
When generate my metadata I would like my namespace seems like: xmlns:tipos="http://www.ginfes.com.br/tipos_v03.xsd"
How as wrote on the 1th.
And what is generated is:
https://gist.github.com/fredericomartini/c2a25073750766c65ecb5bd99f3f9329
Default namespace generate is: xmlns:ns-13a1074f="http://www.ginfes.com.br/tipos_v03.xsd"
Better to understand now?
Thanks @goetas
from xsd2php.
ah, i see.
this is a know limitation of the jms serializer, but schmittjoh/serializer#644 is a fix for it.
planned to be resolved in 1.5 or 1.6 version of jms serializer
from xsd2php.
I have the same problem. I still don't know how to set the root_name. And I don't know how schmittjoh/serializer#644 is solving this?
All I get is a random generated string. For example: xml_root_name: 'ns-0a7b0155:ManifestMessage'
Where is ns-0a7b0155:
coming from? How can I set it myself?
thanks
from xsd2php.
any reason to have a specific prefix? for xml-sematics prefix should be almost irrelevant
from xsd2php.
Unfortunately our delivery house for Spotify rejected our xml's and said the root_name wasn't set as they need.
I understand that a quick fix would be to change the .yml manually, right?
I also need this added xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance”
How can I do this?
The .yml looks like this:
App\Ci\NewReleaseMessage:
xml_root_name: 'ns-61e1d5b4:NewReleaseMessage'
xml_root_namespace: 'http://ddex.net/xml/2010/ern-main/32'
generating this:
<?xml version="1.0" encoding="UTF-8"?>
<ns-0a7b0155:ManifestMessage xmlns:ns-0a7b0155="http://ddex.net/xml/2011/echo/11" MessageVersionId="2010/ern-main/312">
But I need:
<echo:ManifestMessage xmlns:echo="http://ddex.net/xml/2011/echo/11"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ddex.net/xml/2011/echo/11 http://ddex.net/xml/2011/echo/11/echo.xsd"
MessageVersionId="2010/ern-main/312">
Any idea? Thanks again!
from xsd2php.
xsd2php/src/Jms/YamlConverter.php
Line 150 in d7e40e3
from xsd2php.
Hello, is this issue still occuring? I'm having the same problem as reported in this post.
Do we still have to hack xsd2php/src/Jms/YamlConverter.php:150 ?
$data["xml_root_name"] = "ns-" . substr(sha1($data["xml_root_namespace"]), 0, 8) . ":" . $data["xml_root_name"];
Or do we have now something to give what we want?
Thanks
?
from xsd2php.
This the part of code to edit! PR are welcome!
from xsd2php.
Related Issues (20)
- Problems with JMS-Metadata-Generator HOT 4
- Improper PHP code form choice element HOT 2
- Unable to generate PHP classes from XSD file HOT 3
- Declaration of Xsd2PhpExtension::getAlias() must be compatible with Symfony\Component\DependencyInjection\Extension\Extension::getAlias() HOT 4
- Better Handling of xsd:choice
- [Feature Request] Add option to add PHP type declarations
- Handling of xsd:squence with maxOccurs="unbounded"
- Composer requirements version HOT 3
- still uses psr/log:^1.0 - Please add support for psr/log:^3.0 and ^2.0 HOT 3
- CDATA sections not being disabled in XML despite setting xml_cdata to false in goetas-webservices/xsd2php HOT 2
- Can you help me create config.yml
- where are the simpleType restrictions?
- Wrong rendering of PHPDocs in generated classes HOT 2
- Possibility of upgrade goetas-webservices/xsd-reader dependency to 0.4.1 HOT 1
- Uncaught TypeError issue after upgrading to 0.4.11 HOT 1
- Not escaping */ in php comments
- compatible to symfony 7.0 HOT 5
- xs:Choice of xs:Sequence not supported? HOT 2
- ComplexType with single Sequence fails to generate underlying type class
- xsd:sequence produces Uncaught TypeError like xsd:group in #163 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xsd2php.