JaxB xjc生成的pojos包含空名称空间(JaxB xjc generated pojos contains blank namespaces)
我正在使用命令行中的xjc从XSD生成POJO。 这是我运行的命令:
"%java_home%\bin\xjc" -p com.etc.etc.etc.etc ConsolidatedAlert.xsd
对于生成的一些POJO,POJO中的属性如下所示:
@XmlElement(name = "UnparsedTelephone", namespace="") protected String unparsedTelephone;
据我所知,我没有指定这些元素与没有“namespace”属性的其他元素。
以下是XSD的相关部分:
类型声明:
<xs:complexType name="TelephoneType"> <xs:choice> <xs:element name="UnparsedTelephone" type="xs:string"/> <xs:element name="ParsedTelephone" type="ParsedTelephoneType"/> </xs:choice> </xs:complexType>
元素声明:
<xs:element name="Telephone" type="TelephoneType"/>
使用“电话”的地方:
<xs:complexType name="CompanyContactType"> <xs:sequence> <xs:element ref="Telephone"/> </xs:sequence> </xs:complexType>
使用“CompanyContact”的地方:
<xs:complexType name="AmountType"> <xs:sequence> <xs:element ref="CompanyContact" minOccurs="0" /> <xs:element name="TriggerAmount" type="xs:string"/> </xs:sequence> </xs:complexType>
我可以简单地从每个POJO中删除namespace =“”,但这可能需要一点时间,我想更好地了解它为什么会发生在一起。
此外,这是大约8个XSD全部链接在一起。 它们在模式定义中都具有相同的targetNamespace和xmlns,但是其中一些具有elementFormDefault =“unqualified”,而其他的具有elementFormDefault =“qualified”。 这可能是问题的原因吗?
有任何想法吗?
I'm using xjc from the command line to generate POJOs from an XSD. Here's the command I run:
"%java_home%\bin\xjc" -p com.etc.etc.etc.etc ConsolidatedAlert.xsd
For some of the POJOs generated, the properties in the POJO come back like the following:
@XmlElement(name = "UnparsedTelephone", namespace="") protected String unparsedTelephone;
As far as I can tell, I don't specify these elements any differently than others that don't have the "namespace" attribute.
Here's the relevant sections of the XSD:
Type declaration:
<xs:complexType name="TelephoneType"> <xs:choice> <xs:element name="UnparsedTelephone" type="xs:string"/> <xs:element name="ParsedTelephone" type="ParsedTelephoneType"/> </xs:choice> </xs:complexType>
Element declaration:
<xs:element name="Telephone" type="TelephoneType"/>
Where "Telephone" is used:
<xs:complexType name="CompanyContactType"> <xs:sequence> <xs:element ref="Telephone"/> </xs:sequence> </xs:complexType>
Where "CompanyContact" is used:
<xs:complexType name="AmountType"> <xs:sequence> <xs:element ref="CompanyContact" minOccurs="0" /> <xs:element name="TriggerAmount" type="xs:string"/> </xs:sequence> </xs:complexType>
I can simply remove the namespace="" from each POJO, but that can take a bit, and I'd like a better understanding about why it's happening in the first place.
Also, this is about 8 XSDs all linked together. They all have the same targetNamespace and xmlns in the schema definition, but some of them have elementFormDefault="unqualified" and others have elementFormDefault="qualified". Could this be the cause of the problem?
Any ideas?
原文:https://stackoverflow.com/questions/19668802
最满意答案
最后,我带着一个javascript解决方案,在我来之前开始在这里贴出来
<script type="text/javascript"> $(window).scroll(function() { $('#sidebarPage1').css('top', $(this).scrollTop() + "px"); }); </script>
哪些做了工作并且产生了我想要的结果,但是它所取得的效果非常缺乏,因为它看起来非常不平稳和不愉快。
我今天做了更多的Google搜索,并且遇到了这篇文章: 使用jQuery的顶级浮动消息框 。 这导致我到这里
<script type="text/javascript"> $(window).scroll(function() { $('#sidebarPage1').animate({ top: $(window).scrollTop() + "px" }, { queue: false, duration: 500, easing: 'easeInOutSine' }); }); </script>
这对我的边栏产生了很好的干净滚动效果,在我看来,缓解是真正帮助它感觉精美的东西。
In the end I went with a javascript solution where I started with before I came and posted here was
<script type="text/javascript"> $(window).scroll(function() { $('#sidebarPage1').css('top', $(this).scrollTop() + "px"); }); </script>
Which did work and produced the result I wanted however it was very lacking in the effect it achieved because it was very jerky and unpleasant to watch.
I did some more googling today and came across this post: Top Floating message box using jQuery. Which lead me to here
<script type="text/javascript"> $(window).scroll(function() { $('#sidebarPage1').animate({ top: $(window).scrollTop() + "px" }, { queue: false, duration: 500, easing: 'easeInOutSine' }); }); </script>
Which produces a nice clean scrolling effect of my sidebar, the easing in my opinion is what really helps it feel polished.
相关问答
更多-
固定侧边栏垂直居中(Fixed sidebar centered vertically)[2022-09-07]
这就是你要找的。 请注意,移动浏览器将忽略position:fixed因此您需要使用一些js以使其适用于它们。 另外,请确保容器的最小高度为200px; #sidebar { height: 200px; position: fixed; /* Keep in position on scroll */ top: 50%; /* push down 50% of container */ margin-top: -100px; /* bring back u ... -
CSS:Vue.js中的固定侧边栏(CSS: Fixed-sidebar in Vue.js)[2023-05-10]
它在片段中按预期工作,除了我有一个令人费解的事情:它不会为我设置.container-grid 。 我终于弄清楚原因是嵌入式注释( // Main content style ),这是无效的css。 我不知道这可能是您的开发环境中的问题。 new Vue({ el: "#app", components: { sidebar: { template: '#sidebar-template' }, mainContent: { templa ... -
您可以尝试使用此代码,希望它适合您。 HTML:最后,我带着一个javascript解决方案,在我来之前开始在这里贴出来 哪些做了工作并且产生了我想要的结果,但是它所取得的效果非常缺乏,因为它看起来非常不平稳和不愉快。 我今天做了更多的Google搜索,并 ...
全高度布局,折叠和固定侧边栏在bootstrap 3上(Full height layout with collapse and fixed sidebar on bootstrap 3)[2022-11-10]
你很幸运,已经有一个实现可以解决你的问题: http : //startbootstrap.com/simple-sidebar 这是预览: 此外,当分辨率下降时,侧边栏会作为按钮折叠。 此外,您可能希望在使用以下标记遇到问题时禁用用户可伸缩性: You're in luck, there's already an implementatio ...问题出在你的CSS中 - 特别是“>”运算符 - 它意味着“直接后代”,并猜测是什么,内部布局框架集不是直接后代。 更改 body > .ui-layout-pane { padding: 0; } 至 body .ui-layout-pane { padding: 0; } (或完全离开“身体”)它会对你有用 请参阅此处的工作示例 The problem is in your CSS -- in particular the ">" operator -- it means "dire ...使用CSS @media基于窗口的宽度,例如改变风格: @media (max-width: 600px){ #sidebar{ position:relative; height:auto; width:100%; float:left; } #menubar li{ display:inline; } http://jsfiddle.net/X4Yc8/2/ Use css @media to change styles based on window ...iframe侧边栏css(Iframe sidebar css)[2022-08-27]
试试这个,我会编辑我的答案,如果它不起作用。 #sidebar { position: fixed; top: 0; height: 100%; right: 0; width: 100%; } I somehow did it.. CSS #container { width: 450px; max-width: 98%; margin-left: auto; margin-right: auto; position: re ...除非你有其他类型的机制允许你检查用户滚动的距离,并相应地更改元素的CSS属性,否则不可能在没有JavaScript的情况下获得该效果。 No its not possible to get that effect without JavaScript unless you have some other sort of mechanism that allows you to check how far the user has scrolled, and change CSS properties of ...你可以使用position: absolute就像fizzix之前提到的那样,以及你的每个问题与这个html示例相关文章
更多- FreeMarker模板包含及名称空间
- JXLS根据excel模板生成EXCEL并下载
- android---TextView赋值问题
- JDBC系列教程之十一:其他的几个API
- Hadoop MapReduce程序 不包含Reduce的设置
- Hadoop查看目录空间使用情况
- iText生成PDF入门实例
- qq,旺旺,微信在线代码
- 在java中如何获取文件夹占用空间的大小?(注意这里不是问文件夹大小)
- solr4.0 id 自动生成
最新问答
更多- 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
- 如何通过引用返回对象?(How is returning an object by reference possible?)
- 矩阵如何存储在内存中?(How are matrices stored in memory?)
- 每个请求的Java新会话?(Java New Session For Each Request?)
- css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
- 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
- xcode语法颜色编码解释?(xcode syntax color coding explained?)
- 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
- 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
- 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
- 西安哪有PLC可控制编程的培训
- 在Entity Framework中选择基类(Select base class in Entity Framework)
- 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
- 电脑二级VF有什么用
- Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
- 金华英语角.
- 手机软件如何制作
- 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
- 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
- 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
- Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
- 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
- python的访问器方法有哪些
- DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
- 在Ruby中对组合进行排序(Sorting a combination in Ruby)
- 网站开发的流程?
- 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
- 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
- 透明度错误IE11(Transparency bug IE11)
- linux的基本操作命令。。。