From boris at codesynthesis.com Wed Feb 1 14:41:08 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Feb 1 14:35:36 2012 Subject: [xsde-users] xsde xpath generation In-Reply-To: <4ADAE2630FF9F24FA8C6D62E4D29855511649E03AF@StaEx7mb3.telecom.sna.samsung.com> References: <4ADAE2630FF9F24FA8C6D62E4D29855511646EF68B@StaEx7mb3.telecom.sna.samsung.com> <4ADAE2630FF9F24FA8C6D62E4D29855511648D6DC6@StaEx7mb3.telecom.sna.samsung.com> <4ADAE2630FF9F24FA8C6D62E4D29855511649E03AF@StaEx7mb3.telecom.sna.samsung.com> Message-ID: Hi Jeff, Sia Jeffry Saputra writes: > Probably to clear things up, the scenario I was trying to solve > is like below: > > For example: both server and client have book schema. > 1. Client has book data and corresponding data object called book object. > Example: > > Harry Potter > J K. Rowling > 2005 > 29.99 > > 2. Client modified the book's object above. Let say year 2005 to 2010 > 3. The server has interface to access a particular node, so instead > of replacing the whole book, we can use xpath to change particular node. > Like eg: request ("book/year", 2010); > 4. So since the client side is working on the data object book. > It can change it with book.year = 2010 and then store it locally. > 5. But to modify the server, I am just wondering is there any method > to have something like giving the node as parameter and return the > generated xpath query? > Something like: xpathquery = foo (book.year); which will return the > "book/year" query so I can construct the request to server accordingly. I understand better now. Unfortunately I can't think of a way to get this with XSD/e. Such a feature would require each node in the object model to store some kind of a map of child nodes to their names. Each node will also need to store a reference to its parent so that the whole model can be traversed from a child to its ultimate parent (this description should actually remind us of something that has these properties -- DOM). So as you can see, this feature would require quite an elaborate data structure. And this is without even thinking about fundamental types (what if year is int, how can one possibly store a reference to parent there?). One way to make this problem more tractable would be to require a schema to define a unique type for each element/attribute. Then you could create a map between types and their XPath expressions. In fact, if you make each type name encode its XPath, then you could derive the XPath expression directly from typeid(book.year).name(). For example, if year's type is book_year_t, then you could easily convert it to the book/year XPath expression. You could also probably achieve something like this with XSD using the DOM association feature (maintains an association between DOM and object model nodes). Though the DOM association is not automatically updated when the object model is modified. Boris From tom at ntbti.com Sat Feb 18 23:06:06 2012 From: tom at ntbti.com (Tom Laws) Date: Mon Feb 20 06:09:48 2012 Subject: [xsde-users] Errors compiling xmltok_impl.c in XCode4 Message-ID: I followed the instructions in the README for iOS and built the libraries using make. Once I created the XCode project I set all the options for paths and such and tried to build and got the following errors in xmltok_impl.c: s/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:90: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanComment' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:128: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanDecl' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:175: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'checkPiTarget' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:223: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanPi' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:285: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanCdataSection' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:308: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'cdataSectionTok' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:386: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanEndTag' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:435: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanHexCharRef' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:467: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanCharRef' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:499: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanRef' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:529: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanAtts' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:688: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanLt' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:788: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'contentTok' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:887: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanPercent' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:916: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanPoundName' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:943: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanLit' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:975: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'prologTok' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:1206: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'attributeValueTok' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:1264: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'entityValueTok' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:1374: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'isPublicId' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:1434: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'getAtts' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:1527: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'charRefNumber' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:1574: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'predefinedEntityName' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:1630: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sameName' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:1694: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'nameMatchesAscii' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:1709: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'nameLength' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:1736: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'skipS' /Users/lisa/Downloads/xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:1752: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'updatePosition' I double-checked everything and have deleted and re-created new projects numerous times and they are all failing the same way with the same errors When following the instructions, though, I cannot save the "libsxde" dir when creating the project becuase it overwrites (as the instructions say is okay, but ends up nuking src and xsde dirs). So I have had to bring import the xsde dir and files as well as src Second the default compiler is Apple LLVM compiler 3.0 and I manually changed this to LLVM GCC 4.2 (those being the only two actual options). I assume it is something to do with the compiler and/or some other flags that need to be set. Anyone have any ideas what I can do to get this working? This project looks absolutely perfect for me so I would dearly like to use it. Thanks in advance! From boris at codesynthesis.com Mon Feb 20 10:25:24 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Feb 20 10:19:18 2012 Subject: [xsde-users] Errors compiling xmltok_impl.c in XCode4 In-Reply-To: References: Message-ID: Hi Tom, Tom Laws writes: > I followed the instructions in the README for iOS and built the > libraries using make. I think what you mean is that you have generated the src directory using make and then you are trying to create an XCode project to build libxsde. Right? > Once I created the XCode project I set all the options for paths and such > and tried to build and got the following errors in xmltok_impl.c: > > xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:90: > error: expected '=', ',', ';', 'asm' or '__attribute__' before > 'scanComment' > > [...] > > When following the instructions, though, I cannot save the "libsxde" > dir when creating the project becuase it overwrites (as the > instructions say is okay, but ends up nuking src and xsde dirs). I guess this is a new "feature" in the later XCode versions. > So I have had to bring import the xsde dir and files as well as src. Ok, that's why you have the problem. You must not import the xsde directory, only src. The src directory contains all the source files that should be compiled for this configuration. The xsde directory contains all the source files, for all the configurations, as well as files that should not be compiled. xmltok_impl.c is one of those files that should never be compiled directly. If XCode cleans up everything under libxsde, try to temporarily move the xsde, src, etc., directories somewhere, create the project, move them back to libxsde, and then import the src directory only. Boris From tom at ntbti.com Mon Feb 20 15:59:31 2012 From: tom at ntbti.com (Tom Laws) Date: Tue Feb 21 06:09:25 2012 Subject: [xsde-users] Errors compiling xmltok_impl.c in XCode4 In-Reply-To: References: Message-ID: On Mon, Feb 20, 2012 at 7:25 AM, Boris Kolpackov wrote: > Hi Tom, > > Tom Laws writes: > >> I followed the instructions in the README for iOS and built the >> libraries using make. Yes sorry :) > > I think what you mean is that you have generated the src directory using > make and then you are trying to create an XCode project to build libxsde. > Right? > > >> Once I created the XCode project I set all the options for paths and such >> and tried to build and got the following errors in xmltok_impl.c: >> >> xsde-3.2.0-i686-macosx/libxsdee/libxsdee/xsde/c/expat/xmltok_impl.c:90: >> error: expected '=', ',', ';', 'asm' or '__attribute__' before >> 'scanComment' >> >> [...] >> >> When following the instructions, though, I cannot save the "libsxde" >> dir when creating the project becuase it overwrites (as the >> instructions say is okay, but ends up nuking src and xsde dirs). > > I guess this is a new "feature" in the later XCode versions. > > >> So I have had to bring import the xsde dir and files as well as src. > > Ok, that's why you have the problem. You must not import the xsde > directory, only src. The src directory contains all the source files > that should be compiled for this configuration. The xsde directory > contains all the source files, for all the configurations, as well > as files that should not be compiled. xmltok_impl.c is one of those > files that should never be compiled directly. > > If XCode cleans up everything under libxsde, try to temporarily move > the xsde, src, etc., directories somewhere, create the project, move > them back to libxsde, and then import the src directory only. > > Boris That worked perfectly! Thank you for that. Once I created a new project I copied in the entire libxsde dir into the project folder but only imported the src dir to the XCode project. It built perfectly and I was able to build the debug library. Haven't tried to use it yet but that first step worked so thank you again. From antoine.hincelin at non.schneider-electric.com Mon Feb 27 13:02:39 2012 From: antoine.hincelin at non.schneider-electric.com (antoine.hincelin@non.schneider-electric.com) Date: Mon Feb 27 13:00:58 2012 Subject: [xsde-users] xsd:any and xsd:restriction Message-ID: Hi, I would like to know if it is possible to use xsd:restriction on xsd:any element with XSD/e? As an example, I try to process 2 files. First one (test.xml) is: Second one (test2.xml) is: I got the following error: << test2.xsd:8:50: error: unable to match restricted particle >> When changing "restriction" to "extension", I got another error: << :0:0: error: complex type 'NewType' violates the unique particle attribution rule in its components '##other' and 'MyElement' >> The goal is to get a derived type in order to use polymorphism, without modifying first file (test.xsd) Thanks in advance. Best regards Antoine From boris at codesynthesis.com Tue Feb 28 04:35:20 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Feb 28 04:28:13 2012 Subject: [xsde-users] xsd:any and xsd:restriction In-Reply-To: References: Message-ID: Hi Antoine, antoine.hincelin@non.schneider-electric.com writes: > I would like to know if it is possible to use xsd:restriction on xsd:any > element with XSD/e? No, this mechanism is not supported by XSD/e. The workaround would be to introduce an intermediate type: Boris