|
First the issue. I have an Open Source application that uses a database which is contains copyrighted information. This database is an XML database which is obviously a bunch of folders and files under a single folder called RM-XML. I cannot distribute this database to the public, I can only distribute a template which I think makes running this program rather frustrating to users. That is in order to run it they have to create a database. Something that took me weeks to make.
Idea: I would like to somehow compile or encrypt this database folder so that it's unreadable to the end-user akin to either a serialized document or something that has been compiled along with the application so that the .exe itself also holds the XML somewhere in its code. Then I can reference this database in my code. The application uses wxWidgets for the front-end and C++ for the back-end.
I have no idea where to begin other than here to see if anyone has any ideas of how to make this possible, if it really is possible. Maybe I have to export the database to something else and compile it. Hopefully this is enough to allow me to distribute this database with the application.
Thanks!
|
|
|
|
|
You could try zipping the folder with a password, then use the zip file as a file-system from within your program? That's what (for example) Microsoft do with Office 2007 files - a .docx file is just an XML file and folder structure in a zip file...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
hi
I been trying to get an XML from another server. the problem is , i got a form with POST and the form action send me to another page out of my server so i cant read the XML,
i have to do this because i got a service called "dineromail" , i only send a var to the url Action and it returns me an XML but i dont know how read it.
im using PHP or ASP .
The biggest question is how can i read the answer of my form action?
<form name=\"f1\" method=\"GET\" action=\"https://mexico.dineromail.com/vender/Consulta_IPN.asp\" enctype=\"application/x-www-form-urlencoded\" \">
thanks
|
|
|
|
|
This is really more of a Web Development question
but the best answer is to use PHP or ASP to get
the file on your server then make it accessable
to the client.This applies to any file from a
different domain not just xml.
|
|
|
|
|
I go with foreach through all childs of one element and select them. Now when i put every selected child in table, they are written together. How could i seperate them with space or with comma?
|
|
|
|
|
Maybe with <xsl:text> ? That's what I use to produce CSV.
|
|
|
|
|
thats what i was searching for.thx
|
|
|
|
|
Hello,
for a business application in C# I have a more complex object representing an article. Attached to this object there are numerous further objects representing the suppliers, prices, storage locations and quite a few things more. These objects in turn may have further objects or collections with further information. In the end the whole structure represents everything we have in the database concerning this article. Please note, this is not a DataSet. It's a complex data object loaded from the database with NHibernate.
Now we would like to serialize selected articles to XML. We have prepared a XML schema, but now it's the question how we proceed with serializing. I could simply use a XmlWriter class and provide each data object with a method to serialize itself and recursively all attached objects and collections, but I hope there is a better way.
Is there a way to associate the schema with the data objects and their properties and then serialize the data objects with the bonus of not having to write serialization methods for each and every data object and also validation against the schema?
Edit: I took a closer look at the System.Xml.Serialisation namespace, but unfortunately this will not help in this case. The problem is that I would have to decorate a collection of articles with the XmlRoot attribute. Due to the number of articles to be serialized I cannot simply fill some kind of collection and then serialize everything. It must be done one article at a time.
A while ago he asked me what he should have printed on my business cards. I said 'Wizard'.
I read books which nobody else understand. Then I do something which nobody understands. After that the computer does something which nobody understands. When asked, I say things about the results which nobody understand. But everybody expects miracles from me on a regular basis. Looks to me like the classical definition of a wizard.
modified on Tuesday, March 23, 2010 5:58 AM
|
|
|
|
|
I wanna know how to build one element out of three childs so in xml view in browser i could see with value and also i could expand it and see value of childs..for example date..
<!date>12.10.2010<!/date>
should be build out of
<!date>
<!d>12<!/d>
<!m>10<!/m>
<!y>2010<!/y>
<!/date>
How do i do this? I am using xmlspy for building xmls..
Thanks for any help
|
|
|
|
|
This code:
xquery version "1.0";
let $doc := element data {
element row {'abc'},
element row {'def'}
}
return
element results {
for $a in $doc/node()
return
$a/node()
}
returns (as expected)
<results>abcdef</results>
If I change the last line to $fn:replace($a/node(), 'x', 'y') , i.e.,
xquery version "1.0";
let $doc := element data {
element row {'abc'},
element row {'def'}
}
return
element results {
for $a in $doc/node()
return
fn:replace($a/node(), 'x', 'y')
}
The results contain a space between the 'c' and 'd':
<results>abc def</results>
Does anyone have a clue as to where this is coming from? Note that the replace is looking for a character that's not there, so the search string should not be changed.
Thanks.
|
|
|
|
|
i hav made an xml file..as well as an xsd file..i need to refer this xsd file in the xml file..
what should i include in the <xs:schema> tag of the xsd file..?? and what to include in the <root> tag of the xml file..
these r my xsd and xml files respectively..
<code><?xml version="1.0"?>
<xs:schema>
<xs:element name="details">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string">
<xs:element name="age" type="xs:string">
<xs:sequence>
<xs:complexType>
<xs:element>
<xs:schema>
<?xml version="1.0"?>
<details>
<name>abc</name>
<age>22</age>
<details></code>
i am new to xml..i require your help..
thanks a lot in advance..
|
|
|
|
|
Hi,
you have to change the root of your schema file to
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://mynamespace/mydetails">
This will define the xs prefix and the namespace you want to create.
Within your xml file you have to put a reference to the schema by changing the root to this:
<details xmlns="http://mynamespace/mydetails">
Here the namespace is imported without a prefix. But pay attention if you need to validate the xml (if it is valid according to the schema). The reference will be resolved by a DefaultResolver. This one will not find the schema file until you give it a hint.
Simple code to validate an XML file against a schema file (XSD)[^]
Regards
Sebastian
|
|
|
|
|
Do not spam the forums This has nothing to do with XML or XSL I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi
If My XML is:
<person>
<name>Sue</name>
<email>bob@example.com</email>
</person/>
<person>
<name>Sue</name>
<email>sue@example.com</email>
</person>
In C# if I know bob's name how can I get his email address???
Thank You
|
|
|
|
|
You want to use an XPathNavigator[^].
Then use an XPath expression like "//person[name='Bob']/email" to select the email node or "//person[name='Bob']/email/text()" to select the email value.
Here's an example that's very close to what you want.Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
Thanks, but I have solved it by using LINQ
|
|
|
|
|
GIDS is the Biggest Independent Summit for India's IT Professional Ecosystem. Registration for Event Open.
Bangalore, February 26, 2010: JavaServer Faces is a Java-based Web application framework intended developed to simplify development integration of Web-based user interfaces. It is often mentioned together with Ajax, a combination of technologies that makes it possible to create rich user interfaces. Since JSF supports multiple output formats, Ajax-enabled components can easily be added to enrich JSF-based user interfaces. Oracle's Frank Nimphius says that Service Oriented Architecture (SOA) has become a reality in modern software development but Web services don't have a user interface. This is fine if communication is between machines. But what about human interaction like in data entry and work flow? Users need an application display they feel comfortable working with. So what about building Web 2.0 user interfaces for service oriented architectures? Does it work, or does it hurt - and if so, how bad is it? Frank is coming this summer to India's biggest summit for the software developer ecosystem - Great Indian Developer Summit (http://www.developersummit.com/) to show how JavaServer Faces can be used to build compelling Ajax user interfaces for Web Services models giving end users a comfortable working environment that includes client side validation and user interface customization.
In his second session at GIDS 2010, Frank addresses the topic of implementing automatic UI refreshes. To web application users, it must appear as if the Web reinvents itself once a year with more interactive UIs, increasing performance through partial page refreshes, and desktop-like usability patterns that allow users to become as productive using web applications as they are using real desktop clients. One technical detail, though, hasn't changed in the past and is unlikely to change in the near future: HTTP. Hypertext Transfer Protocol is based on the request-response principle in which the client sends a query to the server and the server responds with the requested data. Between requests, no connection is maintained between the client and the server that would allow server-side logic to send more data unasked. Any changes in the underlying data layer used by an application are first detected within the next client request. Hopefully, it doesn't come to you by surprise when we say that in the modern days of Web 2.0 and Rich Enterprise Applications (REA), the Web still is disconnected and stateless. So, in these modern days of Web 2.0 and Rich Enterprise Applications (REA), is the Web still is disconnected and stateless? Not really, because you frequently use some applications on the Web that update their client UIs with server-side changes without your needing to do anything. The question, therefore, is how this was accomplished and whether you can do the same in JavaServer Faces. In his session, Frank will guide attendees through the options that are available in AJAX and other implementation technologies of Rich Internet Applications (RIA) to implement automatic UI refreshes.
Frank Nimphius is a principal product manager for application development tools at Oracle Corporation since 1999. He actively contributes to the development of Oracle JDeveloper and the Oracle Application Development Framework (ADF). He represents the Oracle J2EE development team at J2EE conferences world wide, including various Oracle user groups and the Oracle Open World conference. The talk 'Building Web 2.0 User Interfaces for Web Service Models using JSF' will be co-presented by Jobinesh Purushothaman. Jobinesh Purushothaman is an enterprise Java specialist with 10+ years of experience in the industry. He is involved in design and architectural decisions of various products using ADF and JavaEE technologies. He is interested in developing more simplified enterprise technologies where developers can focus on their business solutions rather on the technology complexities.
About Great Indian Developer Summit
Great Indian Developer Summit is the gold standard for India's software developer ecosystem for gaining exposure to and evaluating new projects, tools, services, platforms, languages, software and standards. Packed with premium knowledge, action plans and advise from been-there-done-it veterans, creators, and visionaries, the 2010 edition of Great Indian Developer Summit features focused sessions, case studies, workshops and power panels that will transform you into a force to reckon with. Featuring 3 co-located conferences: GIDS.NET, GIDS.Web, GIDS.Java and an exclusive day of in-depth tutorials - GIDS.Workshops, from 20 April to 24 April at the IISc campus in Bangalore.
At GIDS you'll participate in hundreds of sessions encompassing the full range of Microsoft computing, Java, Agile, RIA, Rich Web, open source/standards, languages, frameworks and platforms, practical tutorials that deep dive into technical skill and best practices, inspirational keynote presentations, an Expo Hall featuring dozens of the latest projects and products activities, engaging networking events, and the interact with the best and brightest of speakers from around the world.
For further information on GIDS 2010, please visit the summit on the web http://www.developersummit.com/
A Saltmarch Media Press Release
E: info@saltmarch.com
Ph: +91 80 4005 1000
|
|
|
|
|
I am using Visual Studio 2005 to create my first XML Schema. Generally it's going well. The intellisense in VS is very helpful.
My only issue is that VS is flagging the element "Well" in my example, saying "The type attribute cannot be present with either simpleType or complexType." I'm not sure how to structure it if this way isn't acceptable. I've also included a XML snippet of what I am trying define in the schema.
Any help appreciated.
<xsd:element name="Well_Volumes">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Well" type="xsd:decimal">
<xsd:complexType>
<xsd:attribute name="channel" type="xsd:string"/>
<xsd:attribute name="dispense_order" type="xsd:string"/>
<xsd:attribute name="plate_column" type="xsd:string"/>
<xsd:attribute name="plate_row" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<br/>
<br/>
<Well_Volumes>
<Well channel="A" dispense_order="1" plate_column="1" plate_row="1">0.209</Well>
<Well channel="A" dispense_order="2" plate_column="2" plate_row="1">0.212</Well>
<Well channel="A" dispense_order="3" plate_column="3" plate_row="1">0.219</Well>
<Well channel="B" dispense_order="1" plate_column="4" plate_row="2">0.212</Well>
<Well channel="B" dispense_order="2" plate_column="5" plate_row="2">0.222</Well>
<Well channel="B" dispense_order="3" plate_column="6" plate_row="2">0.212</Well>
</Well_Volumes>
|
|
|
|
|
Thanks everyone, but never mind. Although it makes perfect sense to me, apparently an element can not include both attributes and a value. Hmmm... Maybe in the next version.
Below is how I am fixing the problem.
<xsd:element name="Well_Volumes">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Well">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="volume" type="xsd:decimal"/>
</xsd:sequence>
<xsd:attribute name="channel" type="xsd:string"/>
<xsd:attribute name="dispense_order" type="xsd:string"/>
<xsd:attribute name="plate_column" type="xsd:string"/>
<xsd:attribute name="plate_row" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
|
|
|
|
|
You need a simpleContent[^] element as a child of the complexType.
Then extend the simple type with attributes - like this:
<xsd:element name="Well_Volumes">
<xsd:complexType>
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="Well">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:decimal">
<xsd:attribute name="channel" type="xsd:string"/>
<xsd:attribute name="dispense_order" type="xsd:string"/>
<xsd:attribute name="plate_column" type="xsd:string"/>
<xsd:attribute name="plate_row" type="xsd:string"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element> Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
1. Read the section "How to get an answer to your question" above, especially the second point.
2. Everyone loves it to answer questions ASAP or URGENT. Greetings
Covean
|
|
|
|
|
I have some xsl that generally works, except when there are multiple children in a node.
What I get is:
<File>
<Person>Person Name</Person>
<Title>Title 1</Title>
<BoxLocation>Location 1</BoxLocation>
<FileName>File Name 1 </FileName>
<VersionNumber>Version 1</VersionNumber>
<Title>Title 2</Title>
<BoxLocation>Location 2</BoxLocation>
<FileName>File Name 2</FileName>
<VersionNumber>Version 2</VersionNumber>
</File>
What I am after is:
<File>
<Person>Person Name</Person>
<Title>Title 1</Title>
<BoxLocation>Location 1</BoxLocation>
<FileName>File Name 1 </FileName>
<VersionNumber>Version 1</VersionNumber>
</File>
<File>
<Person>Person Name</Person>
<Title>Title 2</Title>
<BoxLocation>Location 2</BoxLocation>
<FileName>File Name 2</FileName>
<VersionNumber>Version 2</VersionNumber>
</File>
The relevant part of the xsl is:
<xsl:for-each select="DBFile">
<File>
<xsl:for-each select="Title">
<Person>
<xsl:value-of select="."/>
</Person>
</xsl:for-each>
<xsl:for-each select="DBPart">
<xsl:for-each select="DBDocument">
<xsl:for-each select="Title">
<Title>
<xsl:value-of select="."/>
</Title>
</xsl:for-each>
<xsl:for-each select="DBMetadataFieldValue">
<xsl:for-each select="DBMetadataValue">
<xsl:for-each select="Text">
<BoxLocation>
<xsl:value-of select="."/>
</BoxLocation>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
<xsl:for-each select="DBVersion">
<xsl:for-each select="ArchiveFileName">
<FileName>
<xsl:value-of select="."/>
</FileName>
</xsl:for-each>
<xsl:for-each select="Number">
<VersionNumber>
<xsl:value-of select="."/>
</VersionNumber>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</File>
</xsl:for-each>
Any advice or assistance pointing me in the right direction will be greatly appreciated.
|
|
|
|
|
Show us the input...
Are you expecting there to be multiple DBPart, DBDocument, etc child nodes? 'Cause if not, the xsl:for-each loops really clutter things up...Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
Hi Stuart,
Thanks for the reply.
The input is quite large. I am working on trying to scale down a sample (and remove sensitive data).
The basic form of the input is:
DBArchive
DBAccount
DBFolder
DBFolder
DBFile
DBPart
DBDocument
There are one, two or three DBDocument nodes inside a DBPart node
My thinking at the moment is that the approach of the xsl is wrong and it should use templates more, but I have very little experience with this stuff and am trying to get my head around how xsl templates work. I assume that I need to get the DBDocument information first,and then go back and fill in the rest. I just don't know how to do that.
Cheers.
(I am in Queensland (Aus), so have gone home now.
|
|
|
|
|
If you can provide a sample, I'm quite happy to help you with your xsl. I've a fair amount of experience with XSL over the years Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|