Search Results

Search found 45013 results on 1801 pages for 'example'.

Page 56/1801 | < Previous Page | 52 53 54 55 56 57 58 59 60 61 62 63  | Next Page >

  • w3schools xsd example won't work with dom4j. How do I use dom4j to validate xml using xsds?

    - by HappyEngineer
    I am trying to use dom4j to validate the xml at http://www.w3schools.com/Schema/schema_example.asp using the xsd from that same page. It fails with the following error: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'shiporder'. I'm using the following code: SAXReader reader = new SAXReader(); reader.setValidation(true); reader.setFeature("http://apache.org/xml/features/validation/schema", true); reader.setErrorHandler(new XmlErrorHandler()); reader.read(in); where in is an InputStream and XmlErrorHandler is a simple class that just logs all errors. I'm using the following xml file: <?xml version="1.0" encoding="ISO-8859-1"?> <shiporder orderid="889923" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="test1.xsd"> <orderperson>John Smith</orderperson> <shipto> <name>Ola Nordmann</name> <address>Langgt 23</address> <city>4000 Stavanger</city> <country>Norway</country> </shipto> <item> <title>Empire Burlesque</title> <note>Special Edition</note> <quantity>1</quantity> <price>10.90</price> </item> <item> <title>Hide your heart</title> <quantity>1</quantity> <price>9.90</price> </item> </shiporder> and the corresponding xsd: <?xml version="1.0" encoding="ISO-8859-1" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:simpleType name="stringtype"> <xs:restriction base="xs:string"/> </xs:simpleType> <xs:simpleType name="inttype"> <xs:restriction base="xs:positiveInteger"/> </xs:simpleType> <xs:simpleType name="dectype"> <xs:restriction base="xs:decimal"/> </xs:simpleType> <xs:simpleType name="orderidtype"> <xs:restriction base="xs:string"> <xs:pattern value="[0-9]{6}"/> </xs:restriction> </xs:simpleType> <xs:complexType name="shiptotype"> <xs:sequence> <xs:element name="name" type="stringtype"/> <xs:element name="address" type="stringtype"/> <xs:element name="city" type="stringtype"/> <xs:element name="country" type="stringtype"/> </xs:sequence> </xs:complexType> <xs:complexType name="itemtype"> <xs:sequence> <xs:element name="title" type="stringtype"/> <xs:element name="note" type="stringtype" minOccurs="0"/> <xs:element name="quantity" type="inttype"/> <xs:element name="price" type="dectype"/> </xs:sequence> </xs:complexType> <xs:complexType name="shipordertype"> <xs:sequence> <xs:element name="orderperson" type="stringtype"/> <xs:element name="shipto" type="shiptotype"/> <xs:element name="item" maxOccurs="unbounded" type="itemtype"/> </xs:sequence> <xs:attribute name="orderid" type="orderidtype" use="required"/> </xs:complexType> <xs:element name="shiporder" type="shipordertype"/> </xs:schema> The xsd and xml file are in the same directory. What is the problem?

    Read the article

  • Avoiding the Controller with Routing Rules in ASP.NET MVC

    - by Ryan Elkins
    I've created a website with ASP.NET MVC. I have a number of static pages that I am currently serving through a single controller called Home. This creates some rather ugly URLs. example.com/Home/About example.com/Home/ContactUs example.com/Home/Features You get the idea. I'd rather not have to create a controller for each one of these as the actions simply call the View with no model being passed in. Is there a way to write a routing rule that will remove the controller from the URL? I'd like it to look like: example.com/About example.com/ContactUs example.com/Features If not, how is this situation normally handled? I imagine I'm not the first person to run in to this.

    Read the article

  • Inferring using Jena

    - by Mikae Combarado
    InfModel infmodel = ModelFactory.createInfModel(reasoner, m); Resource vegetarian = infmodel.getResource(source + "Vegetarian"); Resource margherita = infmodel.getResource(source + "Example-Margherita"); if (infmodel.contains(margherita, RDF., vegetarian)) { System.out.println("Margherita is a memberOf Vegetarian pizza"); } The example given above is formed by formal pizza.owl. In this owl, Example-Margherita is an individual of Margherita class. So, it is already written in owl file. However, the problem is that the reasoner should infer that margherita-example should be also an vegetarian pizza. Could anyone please give an example that shows how to find an individual's possible inferred classes like in Protege ?(Protege correctly infers that Example-Margherita is a Vegetarian Pizza. However, I can't infer programmatically)

    Read the article

  • Static Member Variables of the Same Class in C++

    - by helixed
    I'm trying to create a class which contains a static pointer to an instance of itself. Here's an example: A.h: #include <iostream> #ifndef _A_H #define _A_H class A { static A * a; }; A * a = NULL; #endif However, when I include A.h in another file, such as: #include "A.h" class B { }; I get the following error: ld: duplicate symbol _a in /Users/helixed/Desktop/Example/build/Example.build/Debug/Example.build/Objects-normal/x86_64/B.o and /Users/helixed/Desktop/Example/build/Example.build/Debug/Examplebuild/Objects-normal/x86_64/A.o I'm using the Xcode default compiler on Mac OS X Snow Leopard. Thanks, helixed

    Read the article

  • JavaScript accordion effect won't work, something to do with pseudoclass?

    - by Dennis Hodapp
    I tried to make an accordion effect with JavaScript based off this video altering a few things like using an input button instead of a link for the selector. However for some reason it's not working. Firefox error console outputs unkown pseudo-class or pseudo-element "visible" everytime I try to use it. What's the problem? $("div.example").hide(); $("input.exampleButton").click(function(){ $("div.example:visible").slideUp("slow"); $(this).parent().next().slideDown("slow"); //return false; if you don't want the link to follow }); Here is the HTML input type="button" value="See An Example" class="exampleButton" /> <div class="example"> ...content </div> input type="button" value="See An Example" class="exampleButton" /> <div class="example"> ...content </div>

    Read the article

  • using Java enums or public static fields in MATLAB

    - by Jason S
    I'm wondering how in MATLAB you can get a reference to a Java enum or static public field. In MATLAB, if you are trying to use Java objects/methods, there are equivalents to Java object creation / method call / etc.: Java: new com.example.test.Foo(); MATLAB: javaObject('com.example.test.Foo'); Java: com.example.test.Foo.staticMethod(); MATLAB: javaMethod('staticMethod', 'com.example.test.Foo'); Java: SomeEnum e = com.example.test.SomeEnum.MY_FAVORITE_ENUM; MATLAB: ????? Java: int n = com.example.test.Foo.MAX_FOO; MATLAB: ?????

    Read the article

  • Wordpress is ignoring Unicode Chars in URL

    - by Ankur Gupta
    Hi, I am using wordpress with this type of permalink: /%year%/%monthnum%/%postname%/ if I use this type of url: example.com/2010/03/????? it treats this url like this example.com/2010/03/ (By ignoring unicode chars) and displays March 2010 archive list. if I use english url: example.com/2010/03/technology then it works perfectly. This problem occurs even on tags page: for example example.com/tag/??????? is treated like example.com/tag/ and displays 404 page. Why wordpress is ignoring unicode chars? If I use default querystring structure then it works perfectly even with unicode characters. Server Info: IIS7 Win2008 Server (Url rewriting enabled) Wordpress 2.9.2

    Read the article

  • Linux - Create ftp account with read/write access to only 1 folder

    - by Gublooo
    Hey guys.... I have never worked on linux and dont plan on working on it either - The only command I probably know is "ls" :) I am hosting my website on Eapps and use their cpanel to setup everything so never worked with linux. Now I have this one time case - where I need to provide access to a contractor to fix the CSS issues on my website. He basically needs FTP (read/write) access to certain folders. At a high level - this is my code structure /home/webadmin/example.com/html/images /css /js /login.php /facebook.php /home/webadmin/example.com/application/library /views /models /controllers /config /bootstrap.php /home/webadmin/example.com/cgi-bin I want the new user to be able to have access to only these folders /home/webadmin/example.com/html/js /home/webadmin/example.com/html/css /home/webadmin/example.com/application/views He should not be able to view even the content of other folders including files like bootstrap.php or login.php etc If any sys admins can help me set this account up - will really appreciate it. Thanks

    Read the article

  • Can I use the CSS :visited pseudo class on 'wildcard' links?

    - by rabidpebble
    Let's say I have a site with multiple links as follows: www.example.com/product/1 www.example.com/product/2 www.example.com/product/3 I also append tracking info to links from time to time so that I can see how my site is being used, e.g, if somebody visits the products page from the product browser I would set a ref parameter: www.example.com/product/1&ref=pb www.example.com/product/2&ref=pb www.example.com/product/3&ref=pb The problem with this is that if the user visits a link of the first type and then views a link of the second type then the :visited pseudo class doesn't seem to apply because the browser only seems to match on exact URLs. Is there any way to have "wildcards" apply to links in this sense, so that when the user sees either the first type or the second type of link that it is highlighted? Note: I cannot change this "ref" architecture; it is inherited.

    Read the article

  • Routing configuration in cakephp

    - by ShiVik
    Hello all I am trying to implement routing in cakephp. I want the urls to mapped like this... www.example.com/nodes/main - www.example.com/main www.example.com/nodes/about - www.example.com/about So for this I wrote in my config/routes.php file.. Router::connect('/:action', array('controller' => 'nodes')); Now, I got the thing going but when I click on the links, the url in browser appears like www.example.com/nodes/main www.example.com/nodes/about Is there some way where I can get the urls to appear the way they are routed? Setting in .htaccess or httpd.conf would be easy - but I don't have access to that. Regards Vikram

    Read the article

  • Create an own "OpenID-like system" Provider

    - by user502052
    I know that Facebook use their own OpenID-like system called "Facebook connect", which you can use to authenticate users on your site, among other features. In my case I have multiple Ruby on Rails applications: users.example.com profiles.example.com photos.example.com ... I would like to use 'users.example.com' as a web service that allows users to authenticate to all my other applications the same way as works "Facebook connect" or OpenID. In few words, 'users.example.com' must works as a "OpenID-like system" for my applications in 'example.com'. Can anyone give me tips and links to some useful resources? P.S.: since I am a newbie in this matter, I do not know if I'm saying things that make sense. So someone could help me to understand (if I am wrong) ...

    Read the article

  • Smart pagination algorithm

    - by silvertab
    I'm looking for an example algorithm of smart pagination. By smart, what I mean is that I only want to show, for example, 2 adjacent pages to the current page, so instead of ending up with a ridiculously long page list, I truncate it. Here's a quick example to make it clearer... this is what I have now: Pages: 1 2 3 4 [5] 6 7 8 9 10 11 This is what I want to end up with: Pages: ... 3 4 [5] 6 7 ... (In this example, I'm only showing 2 adjacent pages to the current page) I'm implementing it in PHP/Mysql, and the "basic" pagination (no trucating) is already coded, I'm just looking for an example to optimize it... It can be an example in any language, as long as it gives me an idea as to how to implement it...

    Read the article

  • Is www.example.com/post/21/edit a RESTful URI? I think I know the answer, but have another question.

    - by tmadsen
    I'm almost afraid to post this question, there has to be an obvious answer I've overlooked, but here I go: Context: I am creating a blog for educational purposes (want to learn python and web.py). I've decided that my blog have posts, so I've created a Post class. I've also decided that posts can be created, read, updated, or deleted (so CRUD). So in my Post class, I've created methods that respond to POST, GET, PUT, and DELETE HTTP methods). So far so good. The current problem I'm having is a conceptual one, I know that sending a PUT HTTP message (with an edited Post) to, e.g., /post/52 should update post with id 52 with the body contents of the HTTP message. What I do not know is how to conceptually correctly serve the (HTML) edit page. Will doing it like this: /post/52/edit violate the idea of URI, as 'edit' is not a resource, but an action? On the other side though, could it be considered a resource since all that URI will respond to is a GET method, that will only return an HTML page? So my ultimate question is this: How do I serve an HTML page intended for user editing in a RESTful manner?

    Read the article

  • getting posts from other site network in wordpress 3.0

    - by askkirati
    hello, i have set up the new wordpress 3.0 with multisite network capabilities. What i want to do is get and show blogs from other network site in the main blog. Like if i have set up the blog at example.com and i have other network sites at articles.example.com, movies.example.com. I want to get the posts from the articles.example.com and movies.example.com to show up in the main site at example.com. Is there any parameter in query_post to get the post from different network sites?

    Read the article

  • whats wrong with this peace of code for saving contacts

    - by Shadow
    Hi, i am using the latest Nokia Qt SDK. i have tried to add the contacts, its not getting added.. what is missing here.. // Construct contact manager for default contact backend QContactManager* cm = new QContactManager("simulator"); // QContactManager* cm = new QContactManager("memory"); // i tried this, its also not working // Create example contact QContact example; // Add contact name QContactName name; name.setFirstName("John"); name.setLastName("Doe"); example.saveDetail(&name); // Add contact email address //QContactEmailAddress email; // email.setContexts(QContactDetail::ContextHome); //email.setEmailAddress(“[email protected]”); // example.saveDetail(&email); // Finally, save the contact details cm->saveContact(&example); delete cm; Thanks

    Read the article

  • nodejs response speed and nginx

    - by user1502440
    I'm just started testing nodejs, and wanted to get some help in understanding following behavior: Example #1: var http = require('http'); http.createServer(function(req, res){ res.writeHeader(200, {'Content-Type': 'text/plain'}); res.end('foo'); }).listen(1001, '0.0.0.0'); Example #2: var http = require('http'); http.createServer(function(req, res){ res.writeHeader(200, {'Content-Type': 'text/plain'}); res.write('foo'); res.end('bar'); }).listen(1001, '0.0.0.0'); When testing response time in Chrome: example #1 - 6-10ms example #2 - 200-220ms But, if test both examples through nginx proxy_pass server{ listen 1011; location / { proxy_pass http://127.0.0.1:1001; } } i get this: example #1 - 4-8ms example #2 - 4-8ms I am not an expert on either nodejs or nginx, and asking if someone can explain this? nodejs - v.0.8.1 nginx - v.1.2.2

    Read the article

  • RewriteRule - Doesn't work on live site - subfolder to new domain

    - by eb_Dev
    I have the following rule on my local dev site and it works fine: RewriteCond %{HTTP_HOST} ^localhost$ RewriteRule ^subdomains/example.com(.*) http://www.example.com$1 [R=301,L] However when I change it to: RewriteCond %{HTTP_HOST} ^www.domain.com$ RewriteRule ^subdomains/example.com(.*) http://www.example.com$1 [R=301,L] and upload it to my live site it doesn't work, if i change the rule to: RewriteCond %{HTTP_HOST} ^www.domain.com$ RewriteRule ^subdomains/(.*) http://www.example.com$1 [R=301,L] the rule functions as expected and directs an url beginning with www.domain.com/subdomains/ to www.example.com/. Does anyone know what is going on here? Thanks for you help.

    Read the article

  • Apache Modrewrite & 301 redirect- Dynamic URLs with characters.

    - by Ben Chesters
    I've been trying for weeks, literally, to rename these URLs and also ensure the old one is 301 redirected to the new one: www.example.com/?mod=11&p=215 - www.example.com/clean-url-section www.example.com/?mod=96&tab=6 - www.example.com/clean-url-section-2 Does anyone have any idea why I am having no luck, I got 500 server errors or nothing at all! Is it because of the question marks and characters? I'd be grateful for any help. I have tried this (below) and it seems to be redirecting to the http:// www.example.com/new-page (this page doesn't exist, as I only want it to rename the page BUT use a 301 so that search engines continue you to value it) RewriteCond %{query_string} mod=96&tab=6 RewriteRule (.*) http:// www. example.com/new-page? [R=301,L] Scratching my head!

    Read the article

  • Regex to match pattern with subdomain in java gives issues

    - by Ramesh
    I am trying to match the sub domain of an url using http://([a-z0-9]*.)?example.com/.* which works perfectly for these cases. http://example.com/index.html http://test.example.com/index.html http://test1.example.com/index.html http://www.example.com/122/index.html But the problem is it matches for this URL too. http://www.test.com/?q=http://example.com/index.html if an URL with another domain has the URL in path it matches.Can any one tell me how to match for current domain only. getting the host will work but i need to match full URL.

    Read the article

  • Phonegap 2.1 for Android - Hello World App 3 errors at launch

    - by noway
    I developed something with Phonegap for iOS, but this is my first trial for Android. I created my hello world application with CLI sth like this mentioned here: $ /path/to/cordova-android/bin/create /path/to/my_new_cordova_project com.example.cordova_project_name CordovaProjectName Even though I created this app in Eclipse Workspace, I needed to import it to Eclipse. I created two AVDs. One for API level 8, one for API level 16. When I try to build, it gives me these three errors and a warning. What is wrong with my setup? Description Resource Path Location Type error: No resource identifier found for attribute 'hardwareAccelerated' in package 'android' AndroidManifest.xml /com.example.test.testprojectname line 20 Android AAPT Problem error: No resource identifier found for attribute 'xlargeScreens' in package 'android' AndroidManifest.xml /com.example.test.testprojectname line 22 Android AAPT Problem error: Error: String types not allowed (at 'configChanges' with value 'orientation|keyboardHidden|keyboard|screenSize|locale'). AndroidManifest.xml /com.example.test.testprojectname line 51 Android AAPT Problem The import android.app.Activity is never used testprojectname.java /com.example.test.testprojectname/src/com/example/test line 22 Java Problem

    Read the article

  • Optional URL fragment in Codeigniter?

    - by DA
    This is maybe a simple syntax question or possibly a best-practices question in terms of codeigniter. I should start by saying I'm not a PHP or Codeigniter person so trying to get up to speed on helping on a project. I've found the CI documentation fairly good. The one question I can't find an answer to is how to make part of a URL optional. An example the CI documentation uses is this: example.com/index.php/products/shoes/sandals/123 and then the function used to parse the URI: function shoes($sandals, $id) For my example, I'd like to be able to modify the URL as such: example.com/index.php/products/shoes/all So, if no ID is passed, it's just ignored. Can that be done? Should that be done? A second question unrelated to my problem but pertaining to the example above, why would the variable $sandals be used as in the example, the value is 'sandals'? Shouldn't that variable be something like $shoetype?

    Read the article

  • whats wrong with this piece of code for saving contacts

    - by Shadow
    Hi, i am using the latest Nokia Qt SDK. i have tried to add the contacts, its not getting added.. what is missing here.. // Construct contact manager for default contact backend QContactManager* cm = new QContactManager("simulator"); // QContactManager* cm = new QContactManager("memory"); // i tried this, its also not working // Create example contact QContact example; // Add contact name QContactName name; name.setFirstName("John"); name.setLastName("Doe"); example.saveDetail(&name); // Add contact email address //QContactEmailAddress email; // email.setContexts(QContactDetail::ContextHome); //email.setEmailAddress(“[email protected]”); // example.saveDetail(&email); // Finally, save the contact details cm->saveContact(&example); delete cm; Thanks

    Read the article

  • Replace an element name while retaining the attributes with jquery

    - by geckomist
    I'm trying to create a jquery setup where all instances of <i> are changed to <em>. It's easy enough to do with: $("i").each(function(){ $(this).replaceWith($('<em>' + this.innerHTML + '</em>')); }); But what I am having trouble figuring out is how to change all the <i> tags but retain each ones individual attributes. So if I have <i style="background-color: #333;" alt="Example" title="Example">Example Text</i> I would like it to change to <em style="background-color: #333;" alt="Example" title="Example">Example Text</em> Thanks for any help!

    Read the article

< Previous Page | 52 53 54 55 56 57 58 59 60 61 62 63  | Next Page >