It would make sense to use XML Schema files instead of DTDs. http://jira.openlaszlo.org/jira/browse/LPP-7502
Not sure anyone would have time to work on the compiler/build process to support XML Schema generation. How did the unreleased IDE deal with that problem? Could that approach be re-used here? On Wed, Nov 23, 2011 at 9:12 PM, [email protected] <[email protected]> wrote: > Okay correct would be for example (asuming that lzx.xsd is in the same > folder like the test.lzx): > > test.lzx: > > <?xml version="1.0" encoding="UTF-8"?> > <lzx:canvas xmlns:lzx="http://www.laszlosystems.com/2003/05/lzx" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://www.laszlosystems.com/2003/05/lzx lzx.xsd "> > > <lzx:view name="asddsa"> > > </lzx:view> > > </lzx:canvas> > > Question: > Would it be an idea to make the compile in OpenLaszlo ignore the prefix of > ANY tag ? > > Also to ignore other statements like schema or ":", currently it seems to be > impossible to define a lzx file with valid schema, even if you simple use > this template: > > <?xml version="1.0" encoding="UTF-8"?> > <canvas xmlns="http://www.laszlosystems.com/2003/05/lzx" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://www.laszlosystems.com/2003/05/lzx lzx.xsd "> > </canvas> > => Results in a exception: > > Compilation Errors > > test.lzx:3:130: Syntax error: the token ":" was not expected at this > position.test.lzx:3:126: found an unknown attribute named "schemaLocation" > on element canvas, check the spelling of this attribute name > > The compile should accept those prefix and schema definitions, and just > ignore them. > That way you can use arbitrary prefix, which would make it more easy to > combine for example a "project" or any kind of custom xsd with the global > xsd. > > Making the same with a DTD is a lot more difficult as you need to manually > write a task that combines the DTD into a single file. Also namespaces seem > to be more up-to-date in features to handle complex schemas. > > Further: > The xsd the current build process produces is not correct: > It ignores the possibility to define attribute values in inherited classes, > example: > > <class name="blabla" extends="view" width="200"> > > </class> > > => is invalid. I guess this is something we could live with, you need to > define such attributes in the instance: > <blabla width="200" /> > => would be okay again. However this should be clearly written down in the > docs. > > > Sebastian > > > 2011/11/23 [email protected] <[email protected]> >> >> Starting from my DTD question it seems like another question would be how >> to correctly define XMLNS definitions for a XML file. >> >> Is there an example file that uses the current .xsd ? >> >> XMLNS is somehow more flexible as DTDs are. >> But can openlaszlo handle that? >> >> for example prefixes for xml tags? How does the laszlo-compiler handle for >> example: >> >> <xi:myCustomView> >> >> ? >> >> Does the compile ignore the xi tag or does it anything with it? >> >> Sebastian >> >> -- >> Sebastian Wagner >> http://www.openmeetings.de >> http://www.webbase-design.de >> http://www.wagner-sebastian.com >> [email protected] > > > > -- > Sebastian Wagner > http://www.openmeetings.de > http://www.webbase-design.de > http://www.wagner-sebastian.com > [email protected] >
