Jump to content

Nepomuk

Members
  • Content Count

    9
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Nepomuk

  • Rank
    Newbie
  • Birthday 05/17/1987

Previous Fields

  • Languages
    English, German

Contact Methods

  • Website URL
    http://
  • ICQ
    0

Profile Information

  • Location
    Germany
  1. Well, XForms is a XML dialect, isn't it? ^^ And it may be an unusual approach, but then XForms isn't used much anyway, so any approach could be seen as "esoteric" :-D And about the "fragile" part... Why so? What makes it fragile and what results could that have?About your suggestion with the separate form - do I understand you correctly, that I should create a second form, which sends a request to eXist, asking eXist modify the original XML file and XForms document? That would be a possibility I guess, although I would prefer to have it in a separate instance but in the same document rather than completely separate, if that's possible. Hm, I'll think about it...Oh, and thanks for the syntax correction, that looks promising. I'm getting an error at the moment, but that may just be a mistake I made when changing the document... I'll check that tomorrow and get back to you.Greetings,Nepomuk
  2. Well, that's the sort of thing XSLT was intended for, is it not? :-DMind you, I don't do that yet - I have done some successful tests in that direction, but right now I want to be able to get the XForms -> XML problem dealt with, before I combine everything.I did some more research in the are of XPath and found out about the use of @ - so if I'd change my XML file like above and set my XForm input references so something like "/Data/option@Name" that should work, right? (I'm about to test it, so there's no need to say something like "What happens when you try it?" ^^)Still, I'd have to modify the XPath if I want to create a new tag in my XML file, right? How do I do that?Greetings,Nepomuk[edit]Ah, just realised my mistake... the @ may be part of the solution, but I'd need to compare the value of that attribute somehow... so for example, it would be something like <input ref="/Data/option@name == FirstName">...</input> I know, that that code won't work, but I think it explains what I want to do... Any ideas?[/edit]
  3. OK, I'll have a look at that tutorial and see what I can do with it. Though from your description it seems to me like that will let me define how many <Name> tags I can have in the document, for example.If I'm understanding this correctly, the way to do this may be to have a sort meta-tag with attributes in my XML file, e.g. <Data> <option name="FirstName" value="Peter"/> <option name="LastName" value="Parker"/></Data> If so, how can I access/use such attributes in XForms? I'm guessing, I would have to change the ref-attribute in the input tags somehow? This solution, if it works, would allow the XML document to be valid compared to a schema (although in that case, I'm not sure I'd even need a schema), right?The support isn't so much of a problem in this case, because in the long run, the XForms document should be created by the XML document via XSLT, so as soon as I add a new tag, I automatically add a way of working with it in the Form. So, what I'm planing is: XML ------XSLT-----> XForms /|\ | |________eXist________| I'm beginning to think, that this may be a impossible or at least highly complicated, but I'd still like to try... After all, you can't learn if you don't try. ^^Greetings,Nepomuk
  4. As I said, I'm pretty new to XForms, so I don't know, how to create such a schema. Could you give me an example or a link, which explains that? However, I'm not sure if a schema would solve that, because basically I either have to be able to add a new tag or copy and modify an existing one in the model or make inputs show up, even if there is no tag for them in the model and from my brief experience with XML schemas a while back I seem to remember that these only allow defining a general structure, not modifying an existing one. So, even though I could define <MiddleName> as an optional entry, I may want to add <Age> at some point, which wouldn't be in the structure. And I'm not aware of a possibility to create Meta-tags... But as I said, it's been quite a while. Of course, I could also be completely missing the point here.Oh, and the link about the XForms tutorial and required controls only applies to submissions, as far as I understand it - stuff like "Please give a name, otherwise I won't continue." As far as I know, this doesn't apply to whether an element is visible or not - or am I missing something?Greetings,Nepomuk
  5. OK, I tried leaving the model out and the output is the same - it still shows the input fields and the entries from the XML file. However, if I manually add an input for MiddleName like this: <xf:input ref="/Data/MiddleName"><xf:label>Middle name: </xf:label></xf:input> and don't change the XML file, it won't show the input box. (It will, if I add a <MiddleName/> tag to the XML file.) So, even if the JavaScript you gave me would work, it's something to try at a later stage, I guess... I'm not quite sure, I understand what you're saying... The reason I want to do this is because I want to be able to edit the XML file in a limited way, but that includes adding some tags. In this case, I might have realised that there's more personal information I want to give and I'd like to be able to do that via the web interface instead of by editing the XML- and the XHTML-file.Greetings,Nepomuk
  6. Hm, well I have little experience with scripting, although I'm sure eXist is capable of that. If anyone has experience with that, I'd be glad to get a few tips. Hm, trying it now (eXist is being a bit difficult atm, but that's a different problem), but as far as I remember, it just shows up nothing in that case. Also, that won't allow me to add new tags, will it?Greetings,Nepomuk
  7. Well, I searched for XForms and got results in both the XHTML and the XML forum... so as XForms is something used in XHTML, while XML is just (for lack of a better description) the "general idea behind it", I thought this would be the better choice... But if you think, I'll get better results over there, sure, I'll do that.Greetings,Nepomuk
  8. Hi, I'm Nepomuk and it seems I'm the new guy here. ^^ I'm a CS student from Germany, and at the moment I'm trying to get my XForms project working. With a little help from you guys, I might even manage that. :-DGreetings,Nepomuk
  9. Hi everyone!I'm new both to this forum as to XForms, but I've been working on a project with it and got stuck. Yes, I know, XForms isn't supported natively by most browsers and so on, but I'd like to use it anyway if possible.So, here's my problem: My project uses XForms and eXist, so I have an XML file as a database. My XForms document looks something like this: ... <xf:model version="1.0"> <xf:instance id="data-instance" src="data.xml" xmlns=""> <Data> <FirstName/> <LastName/> </Data> </xf:instance> <xf:submission id="read-from-file" method="get" action="http://localhost:8080/exist/rest/db/eXist_test/data.xml" replace="instance" instance="data-instance"/> <xf:submission id="save-to-file" method="put" action="http://localhost:8080/exist/rest/db/eXist_test/data.xml" replace="instance" instance="data-instance"/> </xf:model> ... <xf:input ref="/Data/FirstName"><xf:label>First Name: </xf:label></xf:input><br/> <xf:input ref="/Data/LastName"><xf:label>Last Name: </xf:label></xf:input><br/> <xf:submit submission="read-from-file"><xf:label>Load</xf:label></xf:submit> <xf:submit submission="save-to-file"><xf:label>Save</xf:label></xf:submit> ... and my XML file looks like this: <Data> <FirstName>Peter</FirstName> <LastName>Parker</LastName></Data> Now, when the document loads, it loads the values from the XML file into the Document, ditto when I click on "Load" and when I click on "Save" it submits the changes to my XML file. So far so good - but now I want to be able to add new tags to the XML file via the webinterface (e.g. <MiddleName>). When I have further paths in my XForms document, they just won't display, unless they belong to a different instance (which isn't a choice I guess, because it will only submit the data of one instance when I save).My idea was therefore to cut out the src="data.xml" part in the instance description and just load the entries manually. Also, the read-from-file submission would have to be changed. However, I can't seem to be able to find anything like that online. Any ideas or suggestions, how do do this differently?Thanks,NepomukEDIT:I just had another thought, maybe this could work, though I have no idea how to implement it:Let's assume, when I want to add a new tag, I click on an "Add" button. What happens then, is that a different instance is selected for saving and this instance gets a copy of the data from the original instance plus the new stuff that's supposed to be added. So, the new question would be: How do I copy data from one instance to another?Greetings,Nepomuk
×
×
  • Create New...