Search Results

Search found 2692 results on 108 pages for 'ignore'.

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

  • non www .htaccess redirect - ignore other subdomains.

    - by qxxx
    Hi, I have a .htaccess redirect for "non www" like this: RewriteEngine on RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] it is working. But, i have also some subdomains other than www. If I call for example http://shop.example.com it redirects me to: http://www.shop.example.com I dont want to write the subdomains into the .htaccess file, it should work automatically, just ignore anything else than www and '' like this: if subdomain =='' -> redirect to www.HTTP_HOST.... elseif subdomain !='' && subdomain !='www' -> do nothing. thanks!

    Read the article

  • Is it possible, with simple F# pattern matching transformations, to ignore unmatched values without

    - by Phobis
    So, I previously asked this question: http://stackoverflow.com/questions/2820234/can-someone-help-me-compare-using-f-over-c-in-this-specific-example-ip-address I was looking at the posted code and I was wondering if this code could be written without it producing a warning: let [|a;b;c;d|] = s.Split [|'.'|] IP(parseOrParts a, parseOrParts b, parseOrParts c, parseOrParts d) Is it possible to do something for the match _ pattern ot ignore? Without adding in something like Active Patterns? i want to keep the code as simple as possible... can I do this without drastically changing this code? NOTE: Warning is as follows Warning Incomplete pattern matches on this expression. For example, the value '[|_; _; _; _; _|]' may indicate a case not covered by the pattern(s).

    Read the article

  • Inserting records in Mysql with INSERT IGNORE and NULL values

    - by Homer1980ar
    I have a partitioned table InnoDB with several fields. I'm trying to avoid duplicates on insert. Let's say: Field1 int null Field2 int null Field3 int null Field4 int null Field5 int null I have created a UNIQUE index on those fields. I try to insert some records with NULL values and then try to reinsert them with IGNORE feature on MySql. Unfortunately it seems to replicated the records when using NULL values. If I try with zeros instead of NULL cases everything works, but I do need the nulls there. Any idea? Thanks, Leonardo

    Read the article

  • Excluding certain file types in wget

    - by Alan Spark
    I have been using wget for a while now to mirror files from an ftp server to a local folder. My wget command is as follows: wget -mirror -w 1 -p -nH -P /var/www/ ftp://my-ftp-server However, I just noticed that it is copying over a .listing file for every folder that it visits. So, even if nothing has been changed on the ftp server, a .listing file will always be copied. My understanding is that the .listing file is created when wget opens the ftp session. Is there a way to avoid this? I've tried the -R option (e.g. -R .listing) but this didn't help. See: http://www.gnu.org/software/wget/manual/wget.html#Recursive-Accept_002fReject-Options Thanks, Alan

    Read the article

  • valgrind - ignore glibc functions?

    - by Jack
    Is it possible to tell valgrind to ignore some set of libraries? Specifically glibc libraries.. Actual Problem: I have some code that runs fine in normal execution. No leaks etc. When I try to run it through valgrind, I get core dumps and program restarts/stops. Core usually points to glibc functions (usually fseek, mutex etc). I understand that there might be some issue with incompatible glibc / valgrind version. I tried various valgrind releases and glibc versions but no luck. Any suggestions?

    Read the article

  • Linq Query ignore empty parameters

    - by Cj Anderson
    How do I get Linq to ignore any parameters that are empty? So Lastname, Firstname, etc? If I have data in all parameters it works fine. refinedresult = From x In theresult _ Where x.<thelastname>.Value.TestPhoneElement(LastName) Or _ x.<thefirstname>.Value.TestPhoneElement(FirstName) Or _ x.<id>.Value.TestPhoneElement(Id) Or _ x.<number>.Value.TestPhoneElement(Telephone) Or _ x.<location>.Value.TestPhoneElement(Location) Or _ x.<building>.Value.TestPhoneElement(building) Or _ x.<department>.Value.TestPhoneElement(Department) _ Select x Public Function TestPhoneElement(ByVal parent As String, ByVal value2compare As String) As Boolean 'find out if a value is null, if not then compare the passed value to see if it starts with Dim ret As Boolean = False If String.IsNullOrEmpty(parent) Then Return False End If If String.IsNullOrEmpty(value2compare) Then Return ret Else ret = parent.ToLower.StartsWith(value2compare.ToLower.Trim) End If Return ret End Function

    Read the article

  • Mercurial: How to ignore changes to a tracked file

    - by Svish
    I have a file with database settings in my project which I have set to some defaults. The file is tracked by mercurial and checked in. Since this file will be edited with different values various developer machines, is there a way I can tell Mercurial to ignore new changes to this file? I tried adding the file to the .hgignore file, but since the file is tracked it isn't ignored. This is alright and good in other situations, but I am wondering if there is something I can do here.

    Read the article

  • Make Codeigniter ignore directory

    - by Noah Goodrich
    I have Codeigniter installed and working for my main site. But I am now trying to add an add-on domain to the same hosting account, so I can have two sites running on the same hosting. Add-on domains make a new folder in the main public_html folder to store the web files. How can I get Codeigniter to ignore this directory? The site doesn't load properly when I try and view it. I have an SSL on the main site too and redirection for www URLS. Here's my .htaccess file: RewriteEngine on Options +FollowSymLinks RewriteBase / RewriteCond %{HTTP_HOST} ^www\.mysite\.co.uk$ [NC] RewriteRule ^(.*)$ http://mysite.co.uk/$1 [L,R=301] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php/$1 RewriteCond %{HTTPS} off RewriteCond %{REQUEST_URI} (site|sections|here) RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] RewriteCond %{HTTPS} onsite|sections|here) RewriteRule ^(.*)$ http://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

    Read the article

  • hibernate jpa criteriabuilder ignore case queries

    - by user373201
    How to do a like ignore case query using criteria builder. For description property I want to do something like upper(description) like '%xyz%' I have the following query CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); CriteriaQuery<Person> personCriteriaQuery = criteriaBuilder.createQuery(Person.class); Root<Person> personRoot = personCriteriaQuery.from(Person.class); personCriteriaQuery.select(personRoot); personCriteriaQuery.where(criteriaBuilder.like(personRoot.get(Person_.description), "%"+filter.getDescription().toUpperCase()+"%")); List<Person> pageResults = entityManager.createQuery(personCriteriaQuery).getResultList();

    Read the article

  • LINQ To SQL ignore unique constraint exception and continue

    - by Martin
    I have a single table in a database called Users Users ------ ID (PK, Identity) Username (Unique Index) I have setup a unique index on the Username table to prevent duplicates. I am then enumerating through a collection and creating a new user in the database for each item. What I want to do is just insert a new user and ignore the exception if the unique key constraint is violated (as it's clearly a duplicate record in that case). This is to avoid having to craft where not exists kind of queries. First off, is this going to be any more efficient or should my insert code be checking for duplicates instead? I'm drawn more to the database having that logic as this prevents any other type of client from inserting duplicate data. My other issue is related to LINQ To SQL. I have the following code: public class TestRepo { DatabaseDataContext database = new DatabaseDataContext(); public void Add(string username) { database.Users.InsertOnSubmit(new User() { Username = username }); } public void Save() { database.SubmitChanges(); } } And then I iterate over a collection and insert new users, ignoring any exceptions: TestRepo repo = new TestRepo(); foreach (var name in new string[] { "Tim", "Bob", "John" }) { try { repo.Add(name); repo.Save(); } catch { } } The first time this is run, great I have three users in the table. If I remove the second one and run this code again, nothing is inserted. I expected the first insert to fail with the exception, the second to succeed (as I just removed that item from the DB) and the third to then fail. What seems to be happening is that once the SqlException is thrown (even though the loop continues to iterate) all of the next inserts fail - even when there isn't a row in the table that would cause a unique violation. Can anyone explain this? P.S. The only workaround I could find was to instantiate the repo each time before the insert, then it worked exactly as excepted - indicating that it's something to do with the LINQ To SQL DataContext. Thanks.

    Read the article

  • Reading a Serial Port - Ignore portion of data written to serial port for certain time

    - by farmerjoe
    I would like to read data coming and Arduino on a serial port on intervals. So essentially something like Take a reading Wait Take a reading Wait Take ... etc. The problem I am facing is that the port will buffer its information so as soon as I call a wait function the data on the serial port will start buffering. Once the wait function finishes I try and read the data again but I am reading from the beginning of the buffer and the data is not current anymore, but instead is the reading taken at roughly the time the wait function began. My question is whether there is a way that I am unaware of to ignore the portion of data read in during that wait period and only read what is currently being delivered on the serial port? I have this something analogous to this so far: import serial s = serial.Serial(path_to_my_serial_port,9600) while True: print s.readline() time.sleep(.5) For explanation purposes I have the Arduino outputting the time since it began its loop. By the python code, the time of each call should be a half second apart. By the serial output the time is incrementing in less than a millisecond. These values do not change regardless of the sleep timing. Sample output: 504 504 504 504 505 505 505 ... As an idea of my end goal, I would like to measure the value of the port, wait a time delay, see what the value is then, wait again, see what the value is then, wait again. I am currently using Python for this but am open to other languages.

    Read the article

  • XSLT: how to ignore line feeds?

    - by arnaud
    Hi, Given this example XML file: <doc> <tag> Hello ! </tag> <tag> My name is John </tag> </doc> And the following XSLT sheet: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:for-each select="doc/tag"> <xsl:value-of select="."/> </xsl:for-each> </xsl:template> </xsl:stylesheet> How should I change it in order to ignore line feeds in the items? In other words, I would like to obtain: Hello! My name is John Without all those those silly line feeds. ...the question is how. Thanks in advance !

    Read the article

  • XSLT: how to ignore unnecessary white space?

    - by arnaud
    Hi, Given this example XML file: <doc> <tag> Hello ! </tag> <tag> My name is John </tag> </doc> And the following XSLT sheet: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:for-each select="doc/tag"> <xsl:value-of select="."/> </xsl:for-each> </xsl:template> </xsl:stylesheet> How should I change it in order to ignore line feeds and convert any group of white-space characters to just one space in the items? In other words, I would like to obtain: Hello! My name is John Without all those those silly line feeds. ...the question is how. Thanks in advance !

    Read the article

  • Sometimes Xcode appears to ignore target build settings?

    - by Derek Clarkson
    Hi all, I've created a iPhone static library project with two targets like this Project -- Library (Device) target -- Library (simulator) target The device target has the SDK set to the device so it produces an armv6/7 library and the simulator target is set to the simulator SDK so it produces an i386 library. The issue I'm having is that the SDK settings on the targets keep getting overridden by the XCode active target setting. i.e. if I build the device target, but the XCode window is showing the active SDK as being the simlulator, XCode will build a simulator library instead of a device library, ignoring the settings of the target. Although it will put it into the *-iphoneos/ directory in the build directories! I originally had the same issue with another static library project, and after a lot of playing around got everything to work correctly. i.e. The targets ignore the XCode active SDK because they have their own specifications of what to build. The problem is that I don't know what made it work in that project and I have not been able to reproduce the issue in it either. Does anyone have any ideas as to what is going on? ciao Derek

    Read the article

  • How to ask BeanUtils to ignore null values

    - by Calm Storm
    Using Commons beanUtils I would like to know how to ask any converter say the Dateconverter to ignore null values and use null as default. As an example consider a public class, public class X { private Date date1; private String string1; //add public getters and setters } and my convertertest as, public class Apache { @Test public void testSimple() throws Exception { X x1 = new X(), x2 = new X(); x1.setString1("X"); x1.setDate1(null); org.apache.commons.beanutils.BeanUtils.copyProperties(x2, x1); //throws ConversionException System.out.println(x2.getString1()); System.out.println(x2.getDate1()); } } The above throws a NPE since the date happens to be null. This looks a very primitive scenario to me which should be handled by default (as in, I would expect x2 to have null value for date1). The doco tells me that I can ask the converter to do this. Can someone point me as to the best way for doing this ? I dont want to get hold of the Converter and isUseDefault() to be true because then I have to do it for all Date, Enum and many other converters !

    Read the article

  • How to make Fluent NHibernate ignore Dictionary properties

    - by Matt Winckler
    I'm trying to make Fluent NHibernate's automapping ignore a Dictionary property on one of my classes, but Fluent is ignoring me instead. Ignoring other types of properties seems to work fine, but even after following the documentation and adding an override for the Dictionary, I still get the following exception when BuildSessionFactory is called: The type or method has 2 generic parameter(s), but 1 generic argument(s) were provided. A generic argument must be provided for each generic parameter. I've tried overriding by property name: .Override<MyClass>(map => { map.IgnoreProperty(x => x.MyDictionaryProperty); }) and also tried implementing ignores using a custom attribute, both of which result in the same exception from BuildSessionFactory. The only thing so far that makes this exception go away is removing the Dictionary property entirely. My question seems to be identical to this one which was never answered (though I'll expand the scope by stating it doesn't matter whether the dictionary is on an abstract base class; the problem always happens for me regardless of what class the property is on). Any takers this time around?

    Read the article

  • How can i ignore map property in NHibernate with setter

    - by Emilio Montes
    i need ignore map property with setter in NHibernate, because the relationship between entities is required. this is my simple model public class Person { public virtual Guid PersonId { get; set; } public virtual string FirstName { get; set; } public virtual string SecondName { get; set; } //this is the property that do not want to map public Credential Credential { get; set; } } public class Credential { public string CodeAccess { get; set; } public bool EsPremium { get; set; } } public sealed class PersonMap : ClassMapping<Person> { public PersonMap() { Table("Person"); Cache(x => x.Usage(CacheUsage.ReadWrite)); Id(x => x.Id, m => { m.Generator(Generators.GuidComb); m.Column("PersonId"); }); Property(x => x.FirstName, map => { map.NotNullable(true); map.Length(255); }); Property(x => x.SecondName, map => { map.NotNullable(true); map.Length(255); }); } } I know that if I leave the property Credential {get;} I was not going to take the map of NHibernate, but I need to set the value. Thanks in advance.

    Read the article

  • Ignore case in Python strings

    - by Paul Oyster
    What is the easiest way to compare strings in Python, ignoring case? Of course one can do (str1.lower() <= str2.lower()), etc., but this created two additional temporary strings (with the obvious alloc/g-c overheads). I guess I'm looking for an equivalent to C's stricmp(). [Some more context requested, so I'll demonstrate with a trivial example:] Suppose you want to sort a looong list of strings. You simply do theList.sort(). This is O(n * log(n)) string comparisons and no memory management (since all strings and list elements are some sort of smart pointers). You are happy. Now, you want to do the same, but ignore the case (let's simplify and say all strings are ascii, so locale issues can be ignored). You can do theList.sort(key=lambda s: s.lower()), but then you cause two new allocations per comparison, plus burden the garbage-collector with the duplicated (lowered) strings. Each such memory-management noise is orders-of-magnitude slower than simple string comparison. Now, with an in-place stricmp()-like function, you do: theList.sort(cmp=stricmp) and it is as fast and as memory-friendly as theList.sort(). You are happy again. The problem is any Python-based case-insensitive comparison involves implicit string duplications, so I was expecting to find a C-based comparisons (maybe in module string). Could not find anything like that, hence the question here. (Hope this clarifies the question).

    Read the article

  • Ignore folders with certain filetypes

    - by gavin19
    I'm trying in vain to rewrite my old Powershell script found here - "$_.extension -eq" not working as intended? - for Python.I have no Python experience or knowledge and my 'script' is a mess but it mostly works. The only thing missing is that I would like to be able to ignore folders which don't contain 'mp3s', or whichever filetype I specify. Here is what I have so far - import os, os.path, fnmatch path = raw_input("Path : ") for filename in os.listdir(path): if os.path.isdir(filename): os.chdir(filename) j = os.path.abspath(os.getcwd()) mp3s = fnmatch.filter(os.listdir(j), '*.txt') if mp3s: target = open("pls.m3u", 'w') for filename in mp3s: target.write(filename) target.write("\n") os.chdir(path) All I would like to be able to do (if possible) is that when the script is looping through the folders that it ignores those which do NOT contain 'mp3s', and removes the 'pls.m3u'. I could only get the script to work properly if I created the 'pls.m3u' by default. The problem is that that creates a lot of empty 'pls.m3u' files in folders which contain only '.jpg' files for example. You get the idea. I'm sure this script is blasphemous to Python users but any help would be greatly appreciated.

    Read the article

  • how to ignore ivy revision number?

    - by user315228
    Guys, I have certain jar files without revision number. But as rev is mandatory attribute for ivy dependency, i am providing the revision attribute. But i have something like (-[revision]) in url resolver. but its taking the module number instead of ignoring the revision attribute. I know it wont ignore the revision attribute as its not null. Following is the output that i get default-cache: no cached resolved revision for perltools#perltools;latest.integration [ivy:retrieve] tried [ivy:retrieve] listing all in [ivy:retrieve] using privateRepo to list all in [ivy:retrieve] ApacheURLLister found URL=[httP://myrepo/ivyRepository/perltools/jars/perltools.jar]. [ivy:retrieve] found 1 resources [ivy:retrieve] found revs: [perltools.jar] [ivy:retrieve] HTTP response status: 404 url=httP://myrepo/ivyRepository/perltools/jars/perltools.jar/perltools-perltools.jar.jar [ivy:retrieve] CLIENT ERROR: Not Found url=httP://myrepo/ivyRepository/perltools/jars/perltools.jar/perltools-perltools.jar.jar Can somebody please explain why its taking module.ext as revision where revision i specified is latest.integration and in myrepo, i dont have revision attribute. its just has [http://myrepo/ivyRepository/perltools/jars//perltools.jar] Can somebody please help me so that i can avoid revision attribute?

    Read the article

  • classic asp ignore comma within speach marks CSV

    - by user2968227
    I Have a CSV File that looks like this 1,HELLO,ENGLISH 2,HELLO1,ENGLISH 3,HELLO2,ENGLISH 4,HELLO3,ENGLISH 5,HELLO4,ENGLISH 6,HELLO5,ENGLISH 7,HELLO6,ENGLISH 8,"HELLO7, HELLO7 ...",ENGLISH 9,HELLO7,ENGLISH 10,HELLO7,ENGLISH I want to step loop through the lines and write to a table using split classic asp function by comma. When Speech marks are present to ignore the comma within those speech marks and take the string. Please help. <% dim csv_to_import,counter,line,fso,objFile csv_to_import="uploads/testLang.csv" set fso = createobject("scripting.filesystemobject") set objFile = fso.opentextfile(server.mappath(csv_to_import)) str_imported_data="<table cellpadding='3' cellspacing='1' border='1'>" Do Until objFile.AtEndOfStream line = split(objFile.ReadLine,",") str_imported_data=str_imported_data&"<tr>" total_records=ubound(line) for i=0 to total_records if i>0 then str_imported_data=str_imported_data&"<td>"&line(i)&"</td>" else str_imported_data=str_imported_data&"<th>"&line(i)&"</th>" end if next str_imported_data=str_imported_data&"</tr>" & chr(13) Loop str_imported_data=str_imported_data&"<caption>Total Number of Records: "&total_records&"</caption></table>" objFile.Close response.Write str_imported_data %>

    Read the article

  • How to ignore the validation of Unknown tags ?

    - by infant programmer
    One more challenge to the XSD capability,I have been sending XML files by my clients, which will be having 0 or more undefined or [call] unexpected tags (May appear in hierarchy). Well they are redundant tags for me .. so I have got to ignore their presence, but along with them there are some set of tags which are required to be validated. This is a sample XML: <root> <undefined_1>one</undefined_1> <undefined_2>two</undefined_2> <node>to_be_validated</node> <undefined_3>two</undefined_3> <undefined_4>two</undefined_4> </root> And the XSD I tried with: <xs:element name="root" type="root"></xs:element> <xs:complexType name="root"> <xs:sequence> <xs:any maxOccurs="2" minOccurs="0"/> <xs:element name="node" type="xs:string"/> <xs:any maxOccurs="2" minOccurs="0"/> </xs:sequence> </xs:complexType XSD doesn't allow this, due to certain reasons. The above mentioned example is just a sample. The practical XML comes with the complex hierarchy of XML tags .. Kindly let me know if you can get a hack of it. By the way, The alternative solution is to insert XSL-transformation, before validation process. Well, I am avoiding it because I need to change the .Net code which triggers validation process, which is supported at the least by my company.

    Read the article

  • Json.Net Issues: StackOverflowException is thrown when serialising circular dependent ISerializable object with ReferenceLoopHandling.Ignore

    - by keyr
    I have a legacy application that used binary serialisation to persist the data. Now we wanted to use Json.net 4.5 to serialise the data without much changes to the existing classes. Things were working nice till we hit a circular dependent class. Is there any workaround to solve this problem? Sample code as shown below [Serializable] class Department : ISerializable { public Employee Manager { get; set; } public string Name { get; set; } public Department() { } public Department( SerializationInfo info, StreamingContext context ) { Manager = ( Employee )info.GetValue( "Manager", typeof( Employee ) ); Name = ( string )info.GetValue( "Name", typeof( string ) ); } public void GetObjectData( SerializationInfo info, StreamingContext context ) { info.AddValue( "Manager", Manager ); info.AddValue( "Name", Name ); } } [Serializable] class Employee : ISerializable { [NonSerialized] //This does not work [XmlIgnore]//This does not work private Department mDepartment; public Department Department { get { return mDepartment; } set { mDepartment = value; } } public string Name { get; set; } public Employee() { } public Employee( SerializationInfo info, StreamingContext context ) { Department = ( Department )info.GetValue( "Department", typeof( Department ) ); Name = ( string )info.GetValue( "Name", typeof( string ) ); } public void GetObjectData( SerializationInfo info, StreamingContext context ) { info.AddValue( "Department", Department ); info.AddValue( "Name", Name ); } } And the test code Department department = new Department(); department.Name = "Dept1"; Employee emp1 = new Employee { Name = "Emp1", Department = department }; department.Manager = emp1; Employee emp2 = new Employee() { Name = "Emp2", Department = department }; IList<Employee> employees = new List<Employee>(); employees.Add( emp1 ); employees.Add( emp2 ); var memoryStream = new MemoryStream(); var formatter = new BinaryFormatter(); formatter.Serialize( memoryStream, employees ); memoryStream.Seek( 0, SeekOrigin.Begin ); IList<Employee> deserialisedEmployees = formatter.Deserialize( memoryStream ) as IList<Employee>; //Works nicely JsonSerializerSettings jsonSS= new JsonSerializerSettings(); jsonSS.TypeNameHandling = TypeNameHandling.Objects; jsonSS.TypeNameAssemblyFormat = FormatterAssemblyStyle.Full; jsonSS.Formatting = Formatting.Indented; jsonSS.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; //This is not working!! //jsonSS.ReferenceLoopHandling = ReferenceLoopHandling.Serialize; //This is also not working!! jsonSS.PreserveReferencesHandling = PreserveReferencesHandling.All; string jsonAll = JsonConvert.SerializeObject( employees, jsonSS ); //Throws stackoverflow exception Edit1: The issue has been reported to Json (http://json.codeplex.com/workitem/23668)

    Read the article

  • Ignore order of elements using xs:extension

    - by Peter Lang
    How can I design my xsd to ignore the sequence of elements? <root> <a/> <b/> </root> <root> <b/> <a/> </root> I need to use extension for code generation reasons, so I tried the following using all: <?xml version="1.0" encoding="UTF-8"?> <xs:schema targetNamespace="http://www.example.com/test" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="http://www.example.com/test" > <xs:complexType name="BaseType"> <xs:all> <xs:element name="a" type="xs:string" /> </xs:all> </xs:complexType> <xs:complexType name="ExtendedType"> <xs:complexContent> <xs:extension base="t:BaseType"> <xs:all> <!-- ERROR --> <xs:element name="b" type="xs:string" /> </xs:all> </xs:extension> </xs:complexContent> </xs:complexType> <xs:element name="root" type="t:ExtendedType"></xs:element> </xs:schema> This xsd is not valid though, the following error is reported at <!-- ERROR -->: cos-all-limited.1.2: An all model group must appear in a particle with {min occurs} = {max occurs} = 1, and that particle must be part of a pair which constitutes the {content type} of a complex type definition. Documentation of cos-all-limited.1.2 says: 1.2 the {term} property of a particle with {max occurs}=1 which is part of a pair which constitutes the {content type} of a complex type definition. I don't really understand this (neither xsd nor English native speaker :) ). Am I doing the wrong thing, am I doing the right thing wrong, or is there no way to achieve this? Thanks!

    Read the article

  • RegEx to ignore / skip everything in html tags

    - by Scott Sumpter
    Looking for a way to combine two Regular Expressions. One to catch the urls and the other to ensure is skips text within html tags. See sample text below functions. Need to pass a block of news text and format text by wrapping urls and email addresses in html tags so users don't have to. The below code works great until there are already html tags within the text. In that case it doubles the html tags. There are plenty of examples to strip html, but I want to just ignore it since the url is already linkified. Also - if there is an easier was to accomplish this, with or without Regex, please let me know. none of my attempts to combine Regexs have worked. coding in ASP.NET VB but will take any workable example/direction. Thanks! ===== Functions ============= Public Shared Function InsertHyperlinks(ByVal inText As String) As String Dim strBuf As String Dim objMatches As Object Dim iStart, iEnd As Integer strBuf = "" iStart = 1 iEnd = 1 Dim strRegUrlEmail As String = "\b(www|http|\S+@)\S+\b" 'RegEx to find urls and email addresses Dim objRegExp As New Regex(strRegUrlEmail, RegexOptions.IgnoreCase) 'Match URLs and emails Dim MatchList As MatchCollection = objRegExp.Matches(inText) If MatchList.Count <> 0 Then objMatches = objRegExp.Matches(inText) For Each Match In MatchList iEnd = Match.Index strBuf = strBuf & Mid(inText, iStart, iEnd - iStart + 1) If InStr(1, Match.Value, "@") Then strBuf = strBuf & HrefGet(Match.Value, "EMAIL", "_BLANK") Else strBuf = strBuf & HrefGet(Match.Value, "WEB", "_BLANK") End If iStart = iEnd + Match.Length + 1 Next strBuf = strBuf & Mid(inText, iStart) InsertHyperlinks = strBuf Else 'No hyperlinks to replace InsertHyperlinks = inText End If End Function Shared Function HrefGet(ByVal url As String, ByVal urlType As String, ByVal Target As String) As String Dim strBuf As String strBuf = "<a href=""" If UCase(urlType) = "WEB" Then If LCase(Left(url, 3)) = "www" Then strBuf = "<a href=""http://" & url & """ Target=""" & _ Target & """>" & url & "</a>" Else strBuf = "<a href=""" & url & """ Target=""" & _ Target & """>" & url & "</a>" End If ElseIf UCase(urlType) = "EMAIL" Then strBuf = "<a href=""mailto:" & url & """ Target=""" & _ Target & """>" & url & "</a>" End If HrefGet = strBuf End Function ===== Sample Text ============= This would be the inText parameter. Midway through the ride, we see a Skip this too. But sometimes we go here [insert normal www dot link dot com]. If you'd like to join us contact Bill Smith at [email protected]. Thanks! sorry stack overflow won't allow multiple hyperlinks to be added. ===== End Sample Text =============

    Read the article

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