Search Results

Search found 646 results on 26 pages for 'restriction'.

Page 9/26 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • XML Schema: Can I make some of an attribute's values be required but still allow other values?

    - by scrotty
    (Note: I cannot change structure of the XML I receive, I am only able to change how I validate it.) Let's say I can get XML like this: <Address Field="Street" Value="123 Main"/> <Address Field="StreetPartTwo" Value="Unit B"/> <Address Field="State" Value="CO"/> <Address Field="Zip" Value="80020"/> <Address Field="SomeOtherCrazyValue" Value="Foo"/> I need to create an XSD schema that validates that "Street", "State" and "Zip" must be present. But I don't care if "StreetPartTwo" or "SomeOTherCrazyValue" is present. If I knew that only the three I care about could be included, I could do this: <xs:element name="Address" type="addressType" maxOccurs="unbounded" minOccurs="3"/> <xs:complexType name="addressType"> <xs:attribute name="Field" use="required"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="Street"/> <xs:enumeration value="State"/> <xs:enumeration value="Zip"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> But this won't work with my case because I may also receive those other Address elements (that also have "Field" attributes) that I don't care about. Any ideas how I can ensure the stuff I care about is present but let the other stuff in too? TIA! Sean

    Read the article

  • Problem in inferring instances that have integer cardinality constraint

    - by Mikae Combarado
    Hello, I have created an RDF/OWL file using Protege 4.1 alpha. I also created a defined class in Protege called CheapPhone. This class has a restriction which is shown below : (hasPrice some integer[< 350]) Whenever, a price of a phone is below 350, it is inferred as CheapPhone. There is no problem for inferring this in Protege 4.1 alpha. However, I cannot infer this using Jena. I also created a defined class called SmartPhone. This class also has a restriction which is shown below : (has3G value true) and (hasInternet value true) Whenever, a phone has 3G and Internet, it is inferred as SmartPhone. In this situation, there is no problem inferring this in both Protege and Jena. I have started to think that there is a problem in default inference engine of Jena. The code that I use in Java is below : Reasoner reasoner = ReasonerRegistry.getOWLReasoner(); reasoner = reasoner.bindSchema(ontModel); OntModelSpec ontModelSpec = OntModelSpec.OWL_MEM_MINI_RULE_INF; ontModelSpec.setReasoner(reasoner); // Create ontology model with reasoner support // ontModel was created and read before, so I don't share the code in order // not to create garbage here OntModel model = ModelFactory.createOntologyModel(ontModelSpec, ontModel); OntClass sPhone = model.getOntClass(ns + "SmartPhone"); ExtendedIterator s = sPhone.listInstances(); while(s.hasNext()) { OntResource mp = (OntResource)s.next(); System.out.println(mp.getURI()); } This code works perfectly and returns me the instances, but when I change the code below and make it appropriate for CheapPhone, it doesn't return anything. OntClass sPhone = model.getOntClass(ns + "CheapPhone"); Am I doing something wrong ?

    Read the article

  • How does one restrict xml with an XML Schema?

    - by John
    Hello, I want to restrict xml with a schema to a specific set. I read this tutorial http://www.w3schools.com/schema/schema_facets.asp This seems to be what I want. So, I'm using Qt to validate this xml <car>BMW</car> Here is the pertinent source code. QXmlSchema schema; schema.load( QUrl("file:///workspace/QtExamples/ValidateXSD/car.xsd") ); if ( schema.isValid() ) { QXmlSchemaValidator validator( schema ); if ( validator.validate( QUrl("file:///workspace/QtExamples/ValidateXSD/car.xml") ) ) { qDebug() << "instance is valid"; } else { qDebug() << "instance is invalid"; } } else { qDebug() << "schema is invalid"; } I expected the xml to match the schema definition. Unexpectedly, QxmlSchemaValidator complains. Error XSDError in file:///workspace/QtExamples/ValidateXSD/car.xml, at line 1, column 5: Content of element car does not match its type definition: String content is not listed in the enumeration facet.. instance is invalid I suspect this is a braino. How does one restrict xml with an XML Schema? Thanks for your time and consideration. Sincerely, -john Here is the xsd from the tutorial. <xs:element name="car"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="Audi"/> <xs:enumeration value="Golf"/> <xs:enumeration value="BMW"/> </xs:restriction> </xs:simpleType> </xs:element>

    Read the article

  • Using JAXB to customise the generation of java enums

    - by belltower
    I'm using an external bindings file when using jaxb against an XML schema. I'm mostly using the bindings file to map from the XML schema primitives to my own types. This is a snippet of the bindings file <jxb:bindings version="1.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ai="http://java.sun.com/xml/ns/jaxb/xjc" extensionBindingPrefixes="ai"> <jxb:bindings schemaLocation="xsdurl" node="xs:schema"> <jxb:globalBindings> <jxb:javaType name="com.companyname.StringType" xmlType="xs:string" parseMethod="parse" printMethod="print" hasNsContext="true"> </jxb:javaType> </jxb:globalBindings> </jxb:bindings> </jxb:bindings> So whenever a xs:string is encountered, the com.companyname.StringType the methods print / parse are called for marshalling/unmarshalling etc. Now if JAXB encounters an xs:enumeration it will generate a java enum. For example: <xs:simpleType name="Address"> <xs:restriction base="xs:string"> <xs:enumeration value="ADDR"/> <xs:enumeration value="PBOX"/> </xs:restriction> </xs:simpleType> public enum Address { ADDR, PBOX, public String value() { return name(); } public static Address fromValue(String v) { return valueOf(v); } } Does anyone know if it is possible to customise the creation of an enum like it is for a primitive? I would like to be able to: Add a standard member variable / other methods to every enum generated by jaxb. Specify the static method used to create the enum.

    Read the article

  • XSD, restrictions and code generation

    - by bob
    Hello, I'm working on some code generation for an existing project and I want to start from a xsd. So I can use tools as Xsd2Code / xsd.exe to generate the code and also the use the xsd to validate the xml. That part works without any problems. I also want to translate some of the restrictions to DataAnnotations (enrich Xsd2Code). For example xs:minInclusive / xs:maxInclusive I can translate to a RangeAttribute. But what to do with custom validation attributes that we created? Can I add custom facets / restrictions? And how? Or is there another solution / best practice. I would like to collect everything in a single (xsd) file so that one file contains the structure of the class (model) including the validation (attributes) that has to be added. <xs:element name="CertainValue"> <xs:simpleType> <xs:restriction base="xs:double"> <xs:minInclusive value="1" /> <xs:maxInclusive value="100" /> <xs_custom:customRule attribute="value" /> </xs:restriction> </xs:simpleType> </xs:element>

    Read the article

  • JAXB code generation: how to remove a zero occurrence field?

    - by reef
    Hi all, I use JAXB 2.1 to generate Java classes from several XSD files, and I have a problem related to complex type restriction. On of the restrictions modifies the occurence configuration from minOccurs="0" maxOccurs="unbounded" to minOccurs="0" maxOccurs="0". Thus this field is not needed anymore in the restricted type. But actually JAXB generates the restricted class with a [0..1] cardinality instead of 0. By the way the generation is tuned with <xjc:treatRestrictionLikeNewType / so that a XSD restriction is not mapped to a Java class inheritance. Here is an example: Here is the way a field is defined in a complex type A: <element name="qualifier" type="CR" maxOccurs="unbounded" minOccurs="0"/ Here is the way the same field is restricted in another complex type B that restricts A: <element name="qualifier" type="CR" minOccurs="0" maxOccurs="0"/ In the A generated class I have: @XmlElement(name = "qualifier") protected List<CR qualifiers; And in the B generated class I have: protected CR qualifiers; With my poor understanding of JAXB the absence of the XmlElement annotation tells JAXB not to marshall/unmarshall this field. Am I wrong? If I am right is there a way to tell JAXB not to generate the qualifiers field at all? This would be in my opinion a much better generation as it respects the constraints. Any idea, thougths on the topic? Thanks!!

    Read the article

  • Duplicate C# web service proxy classes generated for Java types

    - by Sergey
    My question is about integration between a Java web service and a C# .NET client. Service: CXF 2.2.3 with Aegis databinding Client: C#, .NET 3.5 SP1 For some reason Visual Studio generates two C# proxy enums for each Java enum. The generated C# classes do not compile. For example, this Java enum: public enum SqlDialect { GENERIC, SYBASE, SQL_SERVER, ORACLE; } Produces this WSDL: <xsd:simpleType name="SqlDialect"> <xsd:restriction base="xsd:string"> <xsd:enumeration value="GENERIC" /> <xsd:enumeration value="SYBASE" /> <xsd:enumeration value="SQL_SERVER" /> <xsd:enumeration value="ORACLE" /> </xsd:restriction> </xsd:simpleType> For this WSDL Visual Studio generates two partial C# classes (generated comments removed): [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")] [System.Runtime.Serialization.DataContractAttribute(Name="SqlDialect", Namespace="http://somenamespace")] public enum SqlDialect : int { [System.Runtime.Serialization.EnumMemberAttribute()] GENERIC = 0, [System.Runtime.Serialization.EnumMemberAttribute()] SYBASE = 1, [System.Runtime.Serialization.EnumMemberAttribute()] SQL_SERVER = 2, [System.Runtime.Serialization.EnumMemberAttribute()] ORACLE = 3, } [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.3082")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://somenamespace")] public enum SqlDialect { GENERIC, SYBASE, SQL_SERVER, ORACLE, } The resulting C# code does not compile: The namespace 'somenamespace' already contains a definition for 'SqlDialect' I will appreciate any ideas...

    Read the article

  • Using groovy ws with enum types?

    - by Jared
    I'm trying to use groovy ws to call a webservice. One of the properties of the generated class is it's self a class with an enum type. Although the debug messages show that the com.test.FinalActionType is created at runtime when the WSDL is read I can't create an instance of it using code like proxy.create("com.test.FinalActionType") When I try and assign a string to my class uin place of an instance of FinalActionType groovy is not able to do the conversion. How can I get an instance of this class to use in a webservice call? I've pasted the important part of the WSDL below. <xsd:simpleType name="FinalActionType"> <xsd:restriction base="xsd:string"> <xsd:enumeration value="stop"/> <xsd:enumeration value="quit"/> <xsd:enumeration value="continue"/> <xsd:whiteSpace value="collapse"/> </xsd:restriction> </xsd:simpleType>

    Read the article

  • unbuffered I/O in Linux

    - by stuck
    I'm writing lots and lots of data that will not be read again for weeks - as my program runs the amount of free memory on the machine (displayed with 'free' or 'top') drops very quickly, the amount of memory my app uses does not increase - neither does the amount of memory used by other processes. This leads me to believe the memory is being consumed by the filesystems cache - since I do not intend to read this data for a long time I'm hoping to bypass the systems buffers, such that my data is written directly to disk. I dont have dreams of improving perf or being a super ninja, my hope is to give a hint to the filesystem that I'm not going to be coming back for this memory any time soon, so dont spend time optimizing for those cases. On Windows I've faced similar problems and fixed the problem using FILE_FLAG_NO_BUFFERING|FILE_FLAG_WRITE_THROUGH - the machines memory was not consumed by my app and the machine was more usable in general. I'm hoping to duplicate the improvements I've seen but on Linux. On Windows there is the restriction of writing in sector sized pieces, I'm happy with this restriction for the amount of gain I've measured. is there a similar way to do this in Linux?

    Read the article

  • Can't Connect to IIS Ftp Site under Amazon EC2

    - by h3n
    IIS 7.5: Ftp Firewall Suport: Data Ranges 49152-65535 using external Ip of Amazon EC2 static IP Ftp IPv4 Restriction: allow: Amazon EC2 static IP Ftp Authentication: Anonymous: Enabled, Basic: Disabled, IISMgr: Enabled Ftp Authorization: Allow All Users: Read/Write Windows Firewall (Inbound): Open port 21 Open port ranges: 49152-65535 (Outbound) Open port: 20 Amazon EC2 Security Group: Custom TCP Rule: 21 Custom TCP Rule: 49152-65535 It works on Internet Explorer when I typed the address: ftp://localhost on the server but when I entered the Amazon EC2 Static IP (ftp://IPADRESS) it doesnt connect. I cant connect also to FileZilla

    Read the article

  • Apply Local Policy to Terminal Server (Windows Server 2008 R2 Standard - Workgroup )

    - by Param
    I have created 5 local user in Window server 2008 R2 std in workgroup. This server is also Terminal Server. Is it possible to apply local user Policy (gpedit.msc ) per user wise? I want to accomplish the following task 1) Restrict some control panel item as per user 2) Software Restriction as per user 3) Hide Administrative tools in control panel and start menu, only to user which has user rights 4) User must not be able to see other user data Thanks & Regards, Param

    Read the article

  • Localhost doesnot work.

    - by Muhammad Sajid
    Hi, I installed wamp server on xp. During the installation it did not show any error/warning message. Then i start it & type http://localhost/ in url bar but it just show a blank page. I also checked notepad C:\WINDOWS\system32\drivers\etc\hosts their is no restriction for localhost. Help. Thanks...

    Read the article

  • Windows 7 "Family Pack" licenses

    - by bobweber
    Microsoft has provided a 3 license "Family Pack" for Windows 7. The description specifies that it is for 3 computers in one household. How specific is this restriction. Is Microsoft actually checking this, or should we all be running out, purchasing the 3 packs, and reselling the licenses for $80 each?

    Read the article

  • Localhost doesnot work.

    - by Muhammad Sajid
    Hi, I installed wamp server on xp. During the installation it did not show any error/warning message. Then i start it & type http://localhost/ in url bar but it just show a blank page. I also checked notepad C:\WINDOWS\system32\drivers\etc\hosts their is no restriction for localhost. Help. Thanks...

    Read the article

  • Building a Mac/PC Network in a Dorm with Network Restrictions

    - by user70340
    I have been a Windows XP user for the last few years, but I recently bought a 15'' MacBook Pro for research purposes. I would like to set up a no-hassle Mac/PC Network at home so that I can access the internet on both computers and hardware between computers (i.e. a harddrive, or a mouse/keyboard with Synergy). Unfortunately, I live in a dorm with silly network restrictions so a solution is not straightforward. In particular: The dorm has a wired and wireless network, both which provide an internet connection. The wired network provides way faster internet (download speeds of 15 MB/s vs. 2 MB/s on wireless), so I would like to somehow exploit this, at least on my PC for Bittorrent :) Multiple devices can connect to the wireless network, but cannot "see" each other on the network (so software like Synergy would not work). Only 1 MAC address can connect to the wired network at a time. Ideally I would just connect a wireless router to the wired network and then have both the Mac and the PC on that, but the 1 MAC address restriction will not allow the both computer to access the internet simultaneously. I cannot think of a way to bypass this restriction (though I'm not network savvy), so I am planning to create a private no-internet network to allow the devices to see each other and share hardware. Here are some thoughts. I would appreciate any feedback at all! If I build a private wireless network: (first choice) I will use a wireless router that is not connected to the internet. My PC and Mac will be connected to each other wirelessly. I can then connect the PC to the internet via a wired network, but then the Mac will not have internet access as its wireless card is already in use. In this case, could I stream internet access from the PC to the Mac via the wireless network? Or could I buy a USB wireless card for the Mac so that it can connect to both my private network and the dorm network? If I build a private wired network: (second choice) Then both the PC and the Mac will connect to the internet wirelessly, which means I cannot take advantage of the faster download speeds.

    Read the article

  • My internet speed became slow at night

    - by FrozenKing
    My internet plan is 512kbps unlimited and I get speed of average 64kbps but at night I used to get speed of 112kbps ..but recently my speed got normal like day time ...as per my view usually at night their is less traffic so I should get good speed like before ... Due to good speed I download and upload at night and my average download+upload per month is 60gb or 70gb... Is it that my ISP people putting restriction on my download and uploads.. I am confused.

    Read the article

  • Operation Has Been Cancelled in Windows 7!!!

    - by hosseinsinohe
    Hi All I Use Windows 7.I am Not Administrator.I want run executable files in Windows ,but I can not do it,Because when I try System Has a Error: "This Operation has been cancelled due to restriction in effect on this computer.please contact your system administrator". I want Solve this problem,and I do not want contact my Administrator. I try MMC And gpedit.msc but those do not work And I See this Error Again. Please Help me

    Read the article

  • What is the correct way to completely restrict outside connection in Tomcat 8?

    - by user221687
    I'm running Solr on Tomcat 8 on a Windows Server 2008 and I want to complete restrict all access to both except local. I've tried adding address attributes to <connector/> tags in the server.xml file and a couple of other things, but I noticed in each case the problem described was limiting access to a particular area, whereas I want a complete block. What is the correct (e.g. deepest/highest) place to set this access restriction within Tomcat?

    Read the article

  • How to handle business rules with a REST API?

    - by Ciprio
    I have a REST API to manage a booking system I'm searching how to manage this situation : A customer can book a time slot : A TimeSlot resource is created and linked to a Person resource. In order to create the link between a time lot and a person, the REST client send a POST request on the TimeSlot resource But if too many people booked the same slot (let's say the limit is 5 links), it must be impossible to create more associations. How can I handle this business restriction ? Can I return a 404 status code with a JSON response detailing the error with a status code ? Is it a RESTFul approach ? EDIT : Like suggested below I used status 409 Conflict in addition to a JSON response detailing the error

    Read the article

  • Using XNA ContentPipeline to export a file in a machine without full XNA GS

    - by krolth
    My game uses the Content Pipeline to load the spriteSheet at runtime. The artist for the game sends me the modified spritesheet and I do a build in my machine and send him an updated project. So I'm looking for a way to generate the xnb files in his machine (this is the output of the content pipeline) without him having to install the full XNA Game studio. 1) I don't want my artist to install VS + Xna (I know there is a free version of VS but this won't scale once we add more people to the team). 2) I'm not interested in running this editor/tool in Xbox so a Windows only solution works. 3) I'm aware of MSBuild options but they require full XNA I researched Shawn's blog and found the option of using Msbuild Sample or a new option in XNA 4.0 that looked promising here but seems like it has the same restriction: Need to install full XNA GS because the ContentPipeline is not part of the XNA redist. So has anyone found a workaround for this?

    Read the article

  • Ask How-To Geek: How Can I Monitor My Bandwidth Usage?

    - by Jason Fitzpatrick
    If you’re lucky you enjoy wide open internet access with out restriction (or restrictions so high you would have to work all month to meet them). If you’re not so lucky, you’ve got an ISP with heavy caps. Today we help out a reader working under such a cap. Latest Features How-To Geek ETC Internet Explorer 9 RC Now Available: Here’s the Most Interesting New Stuff Here’s a Super Simple Trick to Defeating Fake Anti-Virus Malware How to Change the Default Application for Android Tasks Stop Believing TV’s Lies: The Real Truth About "Enhancing" Images The How-To Geek Valentine’s Day Gift Guide Inspire Geek Love with These Hilarious Geek Valentines Can the Birds and Pigs Really Be Friends in the End? [Angry Birds Video] Add the 2D Version of the New Unity Interface to Ubuntu 10.10 and 11.04 MightyMintyBoost Is a 3-in-1 Gadget Charger Watson Ties Against Human Jeopardy Opponents Peaceful Tropical Cavern Wallpaper SnapBird Supercharges Your Twitter Searches

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >